FPRCPUGaugeData.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. NS_ASSUME_NONNULL_BEGIN
  16. /**
  17. * Class that contains CPU gauge information for any point in time.
  18. */
  19. @interface FPRCPUGaugeData : NSObject
  20. /** @brief Time which which CPU data was measured. */
  21. @property(nonatomic, readonly) NSDate *collectionTime;
  22. /** @brief CPU system time used in microseconds. */
  23. @property(nonatomic, readonly) uint64_t systemTime;
  24. /** @brief CPU user time used in microseconds. */
  25. @property(nonatomic, readonly) uint64_t userTime;
  26. - (instancetype)init NS_UNAVAILABLE;
  27. /**
  28. * Creates an instance of CPU gauge data with the provided information.
  29. *
  30. * @param collectionTime Time at which the gauge data was collected.
  31. * @param systemTime CPU system time in microseconds.
  32. * @param userTime CPU user time in microseconds.
  33. * @return Instance of CPU gauge data.
  34. */
  35. - (instancetype)initWithCollectionTime:(NSDate *)collectionTime
  36. systemTime:(uint64_t)systemTime
  37. userTime:(uint64_t)userTime NS_DESIGNATED_INITIALIZER;
  38. @end
  39. NS_ASSUME_NONNULL_END