FPRTestUtils.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // Copyright 2020 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #import <Foundation/Foundation.h>
  15. #import "FirebasePerformance/Sources/Timer/FIRTrace+Internal.h"
  16. #import "FirebasePerformance/Sources/Timer/FIRTrace+Private.h"
  17. #import "FirebasePerformance/Sources/Loggers/FPRGDTEvent.h"
  18. #import "GoogleDataTransport/GDTCORLibrary/Internal/GoogleDataTransportInternal.h"
  19. #import "FirebasePerformance/ProtoSupport/PerfMetric.pbobjc.h"
  20. NS_ASSUME_NONNULL_BEGIN
  21. @interface FPRTestUtils : NSObject
  22. /** Default initializer. */
  23. - (instancetype)init NS_UNAVAILABLE;
  24. /** Creates a Performance Trace object. */
  25. + (FIRTrace *)createRandomTraceWithName:(NSString *)name;
  26. /** Add verbose session to specific Performance Trace object. */
  27. + (FIRTrace *)addVerboseSessionToTrace:(FIRTrace *)trace;
  28. /** Creates a random Performance Metric Proto object. */
  29. + (FPRMSGPerfMetric *)createRandomPerfMetric:(NSString *)traceName;
  30. /**
  31. * Creates a random Performance Metric Proto object, with verbose
  32. * session ID if it is set as verbose.
  33. */
  34. + (FPRMSGPerfMetric *)createVerboseRandomPerfMetric:(NSString *)traceName;
  35. /** Creates a random internal Performance Metric Proto object. */
  36. + (FPRMSGPerfMetric *)createRandomInternalPerfMetric:(NSString *)traceName;
  37. /** Creates a random network request Performance Metric Proto object. */
  38. + (FPRMSGPerfMetric *)createRandomNetworkPerfMetric:(NSString *)url;
  39. /** Creates a random gauge Performance Metric Proto object. */
  40. + (FPRMSGPerfMetric *)createRandomGaugePerfMetric;
  41. /** Creates a random GDTCOREvent object. */
  42. + (GDTCOREvent *)createRandomTraceGDTEvent:(NSString *)traceName;
  43. /** Creates a random GDTCOREvent object with internal trace event. */
  44. + (GDTCOREvent *)createRandomInternalTraceGDTEvent:(NSString *)traceName;
  45. /** Creates a random GDTCOREvent object with network event. */
  46. + (GDTCOREvent *)createRandomNetworkGDTEvent:(NSString *)url;
  47. @end
  48. NS_ASSUME_NONNULL_END