FPRMemoryGaugeData.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 memory gauge information for any point in time.
  18. */
  19. @interface FPRMemoryGaugeData : NSObject
  20. /** @brief Time at which memory data was measured. */
  21. @property(nonatomic, readonly) NSDate *collectionTime;
  22. /** @brief Heap memory that is used. */
  23. @property(nonatomic, readonly) u_long heapUsed;
  24. /** @brief Heap memory that is available. */
  25. @property(nonatomic, readonly) u_long heapAvailable;
  26. - (instancetype)init NS_UNAVAILABLE;
  27. /**
  28. * Creates an instance of memory gauge data with the provided information.
  29. *
  30. * @param collectionTime Time at which the gauge data was collected.
  31. * @param heapUsed Heap memory that is used.
  32. * @param heapAvailable Heap memory that is available.
  33. * @return Instance of memory gauge data.
  34. */
  35. - (instancetype)initWithCollectionTime:(NSDate *)collectionTime
  36. heapUsed:(u_long)heapUsed
  37. heapAvailable:(u_long)heapAvailable NS_DESIGNATED_INITIALIZER;
  38. @end
  39. NS_ASSUME_NONNULL_END