FPRClient+Private.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 "FirebasePerformance/Sources/FPRClient.h"
  15. #import "FirebasePerformance/Sources/Protogen/nanopb/perf_metric.nanopb.h"
  16. @class FPRGDTLogger;
  17. @class FPRConfigurations;
  18. @class FIRInstallations;
  19. /// Protocol to define the Firebase performance provider for the component framework.
  20. @protocol FIRPerformanceProvider <NSObject>
  21. @end
  22. /**
  23. * Extension that is added on top of the class FPRClient to make the private properties visible
  24. * between the implementation file and the unit tests.
  25. */
  26. @interface FPRClient ()
  27. @property(nonatomic, getter=isConfigured, readwrite) BOOL configured;
  28. /** GDT Logger to transmit Fireperf events to Google Data Transport. */
  29. @property(nonatomic) FPRGDTLogger *gdtLogger;
  30. /** The queue group all FPRClient work will run on. Used for testing only. */
  31. @property(nonatomic, readonly) dispatch_group_t eventsQueueGroup;
  32. /** Serial queue used for processing events. */
  33. @property(nonatomic, readonly) dispatch_queue_t eventsQueue;
  34. /** Firebase Remote Configuration object for FPRClient. */
  35. @property(nonatomic) FPRConfigurations *configuration;
  36. /** Firebase Installations object for FPRClient. */
  37. @property(nonatomic) FIRInstallations *installations;
  38. /** The Firebase Project ID of the project. */
  39. @property(nonatomic, readonly) NSString *projectID;
  40. /** The bundle ID of the project*/
  41. @property(nonatomic, readonly) NSString *bundleID;
  42. /**
  43. * Determines the log directory path in the caches directory.
  44. *
  45. * @return The directory in which Clearcut logs are stored.
  46. */
  47. + (NSString *)logDirectoryPath;
  48. /**
  49. * Cleans up the log directory path in the cache directory created for Clearcut logs storage.
  50. *
  51. * @remark This method (cleanup logic) should stay for a while until all of our apps have migrated
  52. * to a version which includes this logic.
  53. */
  54. + (void)cleanupClearcutCacheDirectory;
  55. /** Performs post processing and logs a firebase_perf_v1_PerfMetric object to Google Data Transport.
  56. * @param event Reference to a firebase_perf_v1_PerfMetric proto object.
  57. */
  58. - (void)processAndLogEvent:(firebase_perf_v1_PerfMetric)event;
  59. @end