FPRProtoUtils.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 <CoreTelephony/CTTelephonyNetworkInfo.h>
  15. #import "FirebasePerformance/Sources/AppActivity/FPRTraceBackgroundActivityTracker.h"
  16. #import "FirebasePerformance/Sources/Instrumentation/FPRNetworkTrace.h"
  17. #import "FirebasePerformance/Sources/Public/FIRTrace.h"
  18. #import "FirebasePerformance/ProtoSupport/PerfMetric.pbobjc.h"
  19. /** Creates a new FPRMSGPerfMetric proto object populated with system metadata.
  20. * @param appID The Google app id to put into the message
  21. * @return Reference to a FPRMSGPerfMetric object.
  22. */
  23. extern FPRMSGPerfMetric* _Nullable FPRGetPerfMetricMessage(NSString* _Nonnull appID);
  24. /** Creates a new FPRMSGApplicationInfo proto object populated with system metadata.
  25. * @return Reference to a FPRMSGApplicationInfo object.
  26. */
  27. extern FPRMSGApplicationInfo* _Nullable FPRGetApplicationInfoMessage(void);
  28. /** Converts the FIRTrace object to a FPRMSGTraceMetric proto object.
  29. * @return Reference to a FPRMSGTraceMetric object.
  30. */
  31. extern FPRMSGTraceMetric* _Nullable FPRGetTraceMetric(FIRTrace* _Nonnull trace);
  32. /** Converts the FPRNetworkTrace object to a FPRMSGNetworkRequestMetric proto object.
  33. * @return Reference to a FPRMSGNetworkRequestMetric object.
  34. */
  35. extern FPRMSGNetworkRequestMetric* _Nullable FPRGetNetworkRequestMetric(
  36. FPRNetworkTrace* _Nonnull trace);
  37. /** Converts the gaugeData array object to a FPRMSGGaugeMetric proto object.
  38. * @return Reference to a FPRMSGGaugeMetric object.
  39. */
  40. extern FPRMSGGaugeMetric* _Nullable FPRGetGaugeMetric(NSArray* _Nonnull gaugeData,
  41. NSString* _Nonnull sessionId);
  42. /** Converts the FPRTraceState to a FPRMSGApplicationProcessState proto value.
  43. * @return FPRMSGApplicationProcessState value.
  44. */
  45. extern FPRMSGApplicationProcessState FPRApplicationProcessState(FPRTraceState state);
  46. /** Obtain a CTTelephonyNetworkInfo object to determine device network attributes.
  47. * @return CTTelephonyNetworkInfo object.
  48. */
  49. extern CTTelephonyNetworkInfo* _Nullable FPRNetworkInfo(void);