FPRFakeConfigurations.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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. #import "FirebasePerformance/Sources/Configurations/FPRConfigurations.h"
  16. NS_ASSUME_NONNULL_BEGIN
  17. // This is a fake Remote Config class to manipulate the inputs.
  18. @interface FPRFakeConfigurations : FPRConfigurations
  19. #pragma mark - Global configurations.
  20. /**
  21. * Sets the data collection state for configurations.
  22. *
  23. * @param dataCollectionEnabled Data collection state to be set.
  24. */
  25. - (void)setDataCollectionEnabled:(BOOL)dataCollectionEnabled;
  26. /**
  27. * Sets the instrumentation state for configurations.
  28. *
  29. * @param instrumentationEnabled Instrumentation state to be set.
  30. */
  31. - (void)setInstrumentationEnabled:(BOOL)instrumentationEnabled;
  32. /**
  33. * Sets the log source for configurations.
  34. *
  35. * @param logSource Log source to be set.
  36. */
  37. - (void)setLogSource:(int)logSource;
  38. /**
  39. * Sets the SDK enabled state for configurations.
  40. *
  41. * @param enabled SDK enabled state to be set.
  42. */
  43. - (void)setSdkEnabled:(BOOL)enabled;
  44. /**
  45. * Sets the Diagnostics enabled state for configurations.
  46. *
  47. * @param enabled Diagnostics enabled state to be set.
  48. */
  49. - (void)setDiagnosticsEnabled:(BOOL)enabled;
  50. #pragma mark - Sampling related configurations.
  51. /**
  52. * Sets the trace sampling rate for configurations.
  53. *
  54. * @param rate Trace sampling rate to be set.
  55. */
  56. - (void)setTraceSamplingRate:(float)rate;
  57. /**
  58. * Sets the network sampling rate for configurations.
  59. *
  60. * @param rate Network sampling rate to be set.
  61. */
  62. - (void)setNetworkSamplingRate:(float)rate;
  63. #pragma mark - Rate limiting related configurations.
  64. /**
  65. * Sets the foreground trace event count for configurations.
  66. *
  67. * @param eventCount Foreground event count to be set.
  68. */
  69. - (void)setForegroundEventCount:(uint32_t)eventCount;
  70. /**
  71. * Sets the foreground trace time limit for configurations.
  72. *
  73. * @param timeLimit Foreground time limit to be set.
  74. */
  75. - (void)setForegroundTimeLimit:(uint32_t)timeLimit;
  76. /**
  77. * Sets the background trace event count for configurations.
  78. *
  79. * @param eventCount Background event count to be set.
  80. */
  81. - (void)setBackgroundEventCount:(uint32_t)eventCount;
  82. /**
  83. * Sets the background trace time limit for configurations.
  84. *
  85. * @param timeLimit Background time limit to be set.
  86. */
  87. - (void)setBackgroundTimeLimit:(uint32_t)timeLimit;
  88. /**
  89. * Sets the foreground network trace event count for configurations.
  90. *
  91. * @param eventCount Foreground network event count to be set.
  92. */
  93. - (void)setForegroundNetworkEventCount:(uint32_t)eventCount;
  94. /**
  95. * Sets the foreground network trace time limit for configurations.
  96. *
  97. * @param timeLimit Foreground network time limit to be set.
  98. */
  99. - (void)setForegroundNetworkTimeLimit:(uint32_t)timeLimit;
  100. /**
  101. * Sets the background network trace event count for configurations.
  102. *
  103. * @param eventCount Background network event count to be set.
  104. */
  105. - (void)setBackgroundNetworkEventCount:(uint32_t)eventCount;
  106. /**
  107. * Sets the background network trace time limit for configurations.
  108. *
  109. * @param timeLimit Background network time limit to be set.
  110. */
  111. - (void)setBackgroundNetworkTimeLimit:(uint32_t)timeLimit;
  112. #pragma mark - Session related configurations.
  113. /**
  114. * Sets the session sampling rate for configurations.
  115. *
  116. * @param rate Sessions sampling rate to be set.
  117. */
  118. - (void)setSessionsSamplingPercentage:(float)rate;
  119. /**
  120. * Sets the max length of sessions (in minutes) for configurations.
  121. *
  122. * @param minutes Maximum sessions length to be set.
  123. */
  124. - (void)setMaxSessionLengthInMinutes:(uint32_t)minutes;
  125. /**
  126. * Sets the CPU sampling frequency when app is in foreground for configurations.
  127. *
  128. * @param frequency CPU sampling frequency when app is in foreground.
  129. */
  130. - (void)setCpuSamplingFrequencyInForegroundInMS:(uint32_t)frequency;
  131. /**
  132. * Sets the CPU sampling frequency when app is in background for configurations.
  133. *
  134. * @param frequency CPU sampling frequency when app is in background.
  135. */
  136. - (void)setCpuSamplingFrequencyInBackgroundInMS:(uint32_t)frequency;
  137. /**
  138. * Sets the memory sampling frequency when app is in foreground for configurations.
  139. *
  140. * @param frequency memory sampling frequency when app is in foreground.
  141. */
  142. - (void)setMemorySamplingFrequencyInForegroundInMS:(uint32_t)frequency;
  143. /**
  144. * Sets the memory sampling frequency when app is in background for configurations.
  145. *
  146. * @param frequency memory sampling frequency when app is in background.
  147. */
  148. - (void)setMemorySamplingFrequencyInBackgroundInMS:(uint32_t)frequency;
  149. @end
  150. NS_ASSUME_NONNULL_END