forked from firebase/firebase-ios-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFPRClient.h
More file actions
85 lines (70 loc) · 3.17 KB
/
FPRClient.h
File metadata and controls
85 lines (70 loc) · 3.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#import "FirebasePerformance/Sources/Public/FirebasePerformance/FIRTrace.h"
#import "FirebasePerformance/Sources/FPRConfiguration.h"
#import "FirebasePerformance/Sources/Gauges/FPRGaugeManager.h"
#import "FirebasePerformance/Sources/Instrumentation/FPRNetworkTrace.h"
/** NSError codes for FPRClient related errors */
typedef NS_ENUM(NSInteger, FPRClientErrorCode) {
// Generic Error.
FPRClientErrorCodeUnknown,
// Error starting the client.
FPRClientErrorCodeStartupError
};
/** This class is not exposed to the public and internally provides the primary entry point into
* the Firebase Performance module's functionality.
*/
NS_EXTENSION_UNAVAILABLE("Firebase Performance is not supported for extensions.")
@interface FPRClient : NSObject
/** YES if SDK is configured, otherwise NO. */
@property(nonatomic, getter=isConfigured, readonly) BOOL configured;
/** YES if methods have been swizzled, NO otherwise. */
@property(nonatomic, getter=isSwizzled) BOOL swizzled;
/** Accesses the singleton instance. All Firebase Performance methods should be managed via this
* shared instance.
* @return Reference to the shared object if successful; <code>nil</code> if not.
*/
+ (nonnull FPRClient *)sharedInstance;
/** Enables performance reporting. This installs auto instrumentation and configures metric
* uploading.
*
* @param config Configures perf reporting behavior.
* @param error Populated with an NSError instance on failure.
* @return <code>YES</code> if successful; <code>NO</code> if not.
*/
- (BOOL)startWithConfiguration:(nonnull FPRConfiguration *)config
error:(NSError *__autoreleasing _Nullable *_Nullable)error;
/** Logs a trace event.
*
* @param trace Trace event that needs to be logged to Google Data Transport.
*/
- (void)logTrace:(nonnull FIRTrace *)trace;
/** Logs a network trace event.
*
* @param trace Network trace event that needs to be logged to Google Data Transport.
*/
- (void)logNetworkTrace:(nonnull FPRNetworkTrace *)trace;
/** Logs a gauge metric event.
*
* @param gaugeData Gauge metric event that needs to be logged to Google Data Transport.
* @param sessionId SessionID with which the gauge data will be logged.
*/
- (void)logGaugeMetric:(nonnull NSArray *)gaugeData forSessionId:(nonnull NSString *)sessionId;
/** Checks if the instrumentation of the app is enabled. If enabled, setup the instrumentation. */
- (void)checkAndStartInstrumentation;
/** Unswizzles any existing methods that have been instrumented and stops automatic instrumentation
* for all future app starts unless explicitly enabled.
*/
- (void)disableInstrumentation;
@end