FIRCLSMockMXCPUExceptionDiagnostic.m 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // Copyright 2021 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 "Crashlytics/UnitTests/Mocks/FIRCLSMockMXCPUExceptionDiagnostic.h"
  15. #if CLS_METRICKIT_SUPPORTED
  16. @interface FIRCLSMockMXCPUExceptionDiagnostic ()
  17. @property(readwrite, strong, nonnull) FIRCLSMockMXCallStackTree *callStackTree;
  18. @property(readwrite, strong, nonnull) NSMeasurement<NSUnitDuration *> *totalCPUTime;
  19. @property(readwrite, strong, nonnull) NSMeasurement<NSUnitDuration *> *totalSampledTime;
  20. @property(readwrite, strong, nonnull) FIRCLSMockMXMetadata *metaData;
  21. @property(readwrite, strong, nonnull) NSString *applicationVersion;
  22. @end
  23. @implementation FIRCLSMockMXCPUExceptionDiagnostic
  24. @synthesize callStackTree = _callStackTree;
  25. @synthesize totalCPUTime = _totalCPUTime;
  26. @synthesize totalSampledTime = _totalSampledTime;
  27. @synthesize metaData = _metaData;
  28. @synthesize applicationVersion = _applicationVersion;
  29. - (instancetype)initWithCallStackTree:(FIRCLSMockMXCallStackTree *)callStackTree
  30. totalCPUTime:(NSMeasurement<NSUnitDuration *> *)totalCPUTime
  31. totalSampledTime:(NSMeasurement<NSUnitDuration *> *)totalSampledTime
  32. metaData:(FIRCLSMockMXMetadata *)metaData
  33. applicationVersion:(NSString *)applicationVersion {
  34. self = [super init];
  35. _totalSampledTime = totalSampledTime;
  36. _totalCPUTime = totalCPUTime;
  37. _callStackTree = callStackTree;
  38. _applicationVersion = applicationVersion;
  39. _metaData = metaData;
  40. return self;
  41. }
  42. @end
  43. #endif