@firebase/performance 0.6.10 → 0.6.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.esm2017.js +1473 -1473
- package/dist/esm/index.esm2017.js.map +1 -1
- package/dist/esm/src/constants.d.ts +32 -32
- package/dist/esm/src/controllers/perf.d.ts +39 -39
- package/dist/esm/src/controllers/perf.test.d.ts +17 -17
- package/dist/esm/src/index.d.ts +46 -46
- package/dist/esm/src/index.test.d.ts +17 -17
- package/dist/esm/src/public_types.d.ts +136 -136
- package/dist/esm/src/resources/network_request.d.ts +43 -43
- package/dist/esm/src/resources/network_request.test.d.ts +17 -17
- package/dist/esm/src/resources/trace.d.ts +119 -119
- package/dist/esm/src/resources/trace.test.d.ts +17 -17
- package/dist/esm/src/services/api_service.d.ts +51 -51
- package/dist/esm/src/services/api_service.test.d.ts +17 -17
- package/dist/esm/src/services/iid_service.d.ts +21 -21
- package/dist/esm/src/services/iid_service.test.d.ts +17 -17
- package/dist/esm/src/services/initialization_service.d.ts +19 -19
- package/dist/esm/src/services/initialization_service.test.d.ts +17 -17
- package/dist/esm/src/services/oob_resources_service.d.ts +18 -18
- package/dist/esm/src/services/oob_resources_service.test.d.ts +17 -17
- package/dist/esm/src/services/perf_logger.d.ts +20 -20
- package/dist/esm/src/services/perf_logger.test.d.ts +17 -17
- package/dist/esm/src/services/remote_config_service.d.ts +18 -18
- package/dist/esm/src/services/remote_config_service.test.d.ts +17 -17
- package/dist/esm/src/services/settings_service.d.ts +32 -32
- package/dist/esm/src/services/transport_service.d.ts +23 -23
- package/dist/esm/src/services/transport_service.test.d.ts +17 -17
- package/dist/esm/src/utils/app_utils.d.ts +20 -20
- package/dist/esm/src/utils/attribute_utils.test.d.ts +17 -17
- package/dist/esm/src/utils/attributes_utils.d.ts +40 -40
- package/dist/esm/src/utils/console_logger.d.ts +18 -18
- package/dist/esm/src/utils/errors.d.ts +60 -60
- package/dist/esm/src/utils/metric_utils.d.ts +28 -28
- package/dist/esm/src/utils/metric_utils.test.d.ts +17 -17
- package/dist/esm/src/utils/string_merger.d.ts +17 -17
- package/dist/esm/src/utils/string_merger.test.d.ts +17 -17
- package/dist/esm/test/setup.d.ts +17 -17
- package/dist/index.cjs.js +1473 -1473
- package/dist/index.cjs.js.map +1 -1
- package/dist/src/constants.d.ts +32 -32
- package/dist/src/controllers/perf.d.ts +39 -39
- package/dist/src/controllers/perf.test.d.ts +17 -17
- package/dist/src/index.d.ts +46 -46
- package/dist/src/index.test.d.ts +17 -17
- package/dist/src/public_types.d.ts +136 -136
- package/dist/src/resources/network_request.d.ts +43 -43
- package/dist/src/resources/network_request.test.d.ts +17 -17
- package/dist/src/resources/trace.d.ts +119 -119
- package/dist/src/resources/trace.test.d.ts +17 -17
- package/dist/src/services/api_service.d.ts +51 -51
- package/dist/src/services/api_service.test.d.ts +17 -17
- package/dist/src/services/iid_service.d.ts +21 -21
- package/dist/src/services/iid_service.test.d.ts +17 -17
- package/dist/src/services/initialization_service.d.ts +19 -19
- package/dist/src/services/initialization_service.test.d.ts +17 -17
- package/dist/src/services/oob_resources_service.d.ts +18 -18
- package/dist/src/services/oob_resources_service.test.d.ts +17 -17
- package/dist/src/services/perf_logger.d.ts +20 -20
- package/dist/src/services/perf_logger.test.d.ts +17 -17
- package/dist/src/services/remote_config_service.d.ts +18 -18
- package/dist/src/services/remote_config_service.test.d.ts +17 -17
- package/dist/src/services/settings_service.d.ts +32 -32
- package/dist/src/services/transport_service.d.ts +23 -23
- package/dist/src/services/transport_service.test.d.ts +17 -17
- package/dist/src/utils/app_utils.d.ts +20 -20
- package/dist/src/utils/attribute_utils.test.d.ts +17 -17
- package/dist/src/utils/attributes_utils.d.ts +40 -40
- package/dist/src/utils/console_logger.d.ts +18 -18
- package/dist/src/utils/errors.d.ts +60 -60
- package/dist/src/utils/metric_utils.d.ts +28 -28
- package/dist/src/utils/metric_utils.test.d.ts +17 -17
- package/dist/src/utils/string_merger.d.ts +17 -17
- package/dist/src/utils/string_merger.test.d.ts +17 -17
- package/dist/test/setup.d.ts +17 -17
- package/package.json +7 -7
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2020 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
import { FirebaseApp } from '@firebase/app';
|
|
18
|
-
import { _FirebaseInstallationsInternal } from '@firebase/installations';
|
|
19
|
-
import { PerformanceSettings, FirebasePerformance } from '../public_types';
|
|
20
|
-
export declare class PerformanceController implements FirebasePerformance {
|
|
21
|
-
readonly app: FirebaseApp;
|
|
22
|
-
readonly installations: _FirebaseInstallationsInternal;
|
|
23
|
-
private initialized;
|
|
24
|
-
constructor(app: FirebaseApp, installations: _FirebaseInstallationsInternal);
|
|
25
|
-
/**
|
|
26
|
-
* This method *must* be called internally as part of creating a
|
|
27
|
-
* PerformanceController instance.
|
|
28
|
-
*
|
|
29
|
-
* Currently it's not possible to pass the settings object through the
|
|
30
|
-
* constructor using Components, so this method exists to be called with the
|
|
31
|
-
* desired settings, to ensure nothing is collected without the user's
|
|
32
|
-
* consent.
|
|
33
|
-
*/
|
|
34
|
-
_init(settings?: PerformanceSettings): void;
|
|
35
|
-
set instrumentationEnabled(val: boolean);
|
|
36
|
-
get instrumentationEnabled(): boolean;
|
|
37
|
-
set dataCollectionEnabled(val: boolean);
|
|
38
|
-
get dataCollectionEnabled(): boolean;
|
|
39
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { FirebaseApp } from '@firebase/app';
|
|
18
|
+
import { _FirebaseInstallationsInternal } from '@firebase/installations';
|
|
19
|
+
import { PerformanceSettings, FirebasePerformance } from '../public_types';
|
|
20
|
+
export declare class PerformanceController implements FirebasePerformance {
|
|
21
|
+
readonly app: FirebaseApp;
|
|
22
|
+
readonly installations: _FirebaseInstallationsInternal;
|
|
23
|
+
private initialized;
|
|
24
|
+
constructor(app: FirebaseApp, installations: _FirebaseInstallationsInternal);
|
|
25
|
+
/**
|
|
26
|
+
* This method *must* be called internally as part of creating a
|
|
27
|
+
* PerformanceController instance.
|
|
28
|
+
*
|
|
29
|
+
* Currently it's not possible to pass the settings object through the
|
|
30
|
+
* constructor using Components, so this method exists to be called with the
|
|
31
|
+
* desired settings, to ensure nothing is collected without the user's
|
|
32
|
+
* consent.
|
|
33
|
+
*/
|
|
34
|
+
_init(settings?: PerformanceSettings): void;
|
|
35
|
+
set instrumentationEnabled(val: boolean);
|
|
36
|
+
get instrumentationEnabled(): boolean;
|
|
37
|
+
set dataCollectionEnabled(val: boolean);
|
|
38
|
+
get dataCollectionEnabled(): boolean;
|
|
39
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2020 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
import '../../test/setup';
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import '../../test/setup';
|
package/dist/esm/src/index.d.ts
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The Firebase Performance Monitoring Web SDK.
|
|
3
|
-
* This SDK does not work in a Node.js environment.
|
|
4
|
-
*
|
|
5
|
-
* @packageDocumentation
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* @license
|
|
9
|
-
* Copyright 2020 Google LLC
|
|
10
|
-
*
|
|
11
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
-
* you may not use this file except in compliance with the License.
|
|
13
|
-
* You may obtain a copy of the License at
|
|
14
|
-
*
|
|
15
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
-
*
|
|
17
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
-
* See the License for the specific language governing permissions and
|
|
21
|
-
* limitations under the License.
|
|
22
|
-
*/
|
|
23
|
-
import { FirebasePerformance, PerformanceSettings, PerformanceTrace } from './public_types';
|
|
24
|
-
import { FirebaseApp } from '@firebase/app';
|
|
25
|
-
import '@firebase/installations';
|
|
26
|
-
/**
|
|
27
|
-
* Returns a {@link FirebasePerformance} instance for the given app.
|
|
28
|
-
* @param app - The {@link @firebase/app#FirebaseApp} to use.
|
|
29
|
-
* @public
|
|
30
|
-
*/
|
|
31
|
-
export declare function getPerformance(app?: FirebaseApp): FirebasePerformance;
|
|
32
|
-
/**
|
|
33
|
-
* Returns a {@link FirebasePerformance} instance for the given app. Can only be called once.
|
|
34
|
-
* @param app - The {@link @firebase/app#FirebaseApp} to use.
|
|
35
|
-
* @param settings - Optional settings for the {@link FirebasePerformance} instance.
|
|
36
|
-
* @public
|
|
37
|
-
*/
|
|
38
|
-
export declare function initializePerformance(app: FirebaseApp, settings?: PerformanceSettings): FirebasePerformance;
|
|
39
|
-
/**
|
|
40
|
-
* Returns a new `PerformanceTrace` instance.
|
|
41
|
-
* @param performance - The {@link FirebasePerformance} instance to use.
|
|
42
|
-
* @param name - The name of the trace.
|
|
43
|
-
* @public
|
|
44
|
-
*/
|
|
45
|
-
export declare function trace(performance: FirebasePerformance, name: string): PerformanceTrace;
|
|
46
|
-
export { FirebasePerformance, PerformanceSettings, PerformanceTrace };
|
|
1
|
+
/**
|
|
2
|
+
* The Firebase Performance Monitoring Web SDK.
|
|
3
|
+
* This SDK does not work in a Node.js environment.
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* @license
|
|
9
|
+
* Copyright 2020 Google LLC
|
|
10
|
+
*
|
|
11
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
+
* you may not use this file except in compliance with the License.
|
|
13
|
+
* You may obtain a copy of the License at
|
|
14
|
+
*
|
|
15
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
+
*
|
|
17
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
+
* See the License for the specific language governing permissions and
|
|
21
|
+
* limitations under the License.
|
|
22
|
+
*/
|
|
23
|
+
import { FirebasePerformance, PerformanceSettings, PerformanceTrace } from './public_types';
|
|
24
|
+
import { FirebaseApp } from '@firebase/app';
|
|
25
|
+
import '@firebase/installations';
|
|
26
|
+
/**
|
|
27
|
+
* Returns a {@link FirebasePerformance} instance for the given app.
|
|
28
|
+
* @param app - The {@link @firebase/app#FirebaseApp} to use.
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
export declare function getPerformance(app?: FirebaseApp): FirebasePerformance;
|
|
32
|
+
/**
|
|
33
|
+
* Returns a {@link FirebasePerformance} instance for the given app. Can only be called once.
|
|
34
|
+
* @param app - The {@link @firebase/app#FirebaseApp} to use.
|
|
35
|
+
* @param settings - Optional settings for the {@link FirebasePerformance} instance.
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
38
|
+
export declare function initializePerformance(app: FirebaseApp, settings?: PerformanceSettings): FirebasePerformance;
|
|
39
|
+
/**
|
|
40
|
+
* Returns a new `PerformanceTrace` instance.
|
|
41
|
+
* @param performance - The {@link FirebasePerformance} instance to use.
|
|
42
|
+
* @param name - The name of the trace.
|
|
43
|
+
* @public
|
|
44
|
+
*/
|
|
45
|
+
export declare function trace(performance: FirebasePerformance, name: string): PerformanceTrace;
|
|
46
|
+
export { FirebasePerformance, PerformanceSettings, PerformanceTrace };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2020 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
import '../test/setup';
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import '../test/setup';
|
|
@@ -1,136 +1,136 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2020 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
import { FirebaseApp } from '@firebase/app';
|
|
18
|
-
/**
|
|
19
|
-
* Defines configuration options for the Performance Monitoring SDK.
|
|
20
|
-
*
|
|
21
|
-
* @public
|
|
22
|
-
*/
|
|
23
|
-
export interface PerformanceSettings {
|
|
24
|
-
/** Whether to collect custom events. */
|
|
25
|
-
dataCollectionEnabled?: boolean;
|
|
26
|
-
/** Whether to collect out of the box events. */
|
|
27
|
-
instrumentationEnabled?: boolean;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* The Firebase Performance Monitoring service interface.
|
|
31
|
-
*
|
|
32
|
-
* @public
|
|
33
|
-
*/
|
|
34
|
-
export interface FirebasePerformance {
|
|
35
|
-
/**
|
|
36
|
-
* The {@link @firebase/app#FirebaseApp} this `FirebasePerformance` instance is associated with.
|
|
37
|
-
*/
|
|
38
|
-
app: FirebaseApp;
|
|
39
|
-
/**
|
|
40
|
-
* Controls the logging of automatic traces and HTTP/S network monitoring.
|
|
41
|
-
*/
|
|
42
|
-
instrumentationEnabled: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Controls the logging of custom traces.
|
|
45
|
-
*/
|
|
46
|
-
dataCollectionEnabled: boolean;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* The interface representing a `Trace`.
|
|
50
|
-
*
|
|
51
|
-
* @public
|
|
52
|
-
*/
|
|
53
|
-
export interface PerformanceTrace {
|
|
54
|
-
/**
|
|
55
|
-
* Starts the timing for the trace instance.
|
|
56
|
-
*/
|
|
57
|
-
start(): void;
|
|
58
|
-
/**
|
|
59
|
-
* Stops the timing of the trace instance and logs the data of the instance.
|
|
60
|
-
*/
|
|
61
|
-
stop(): void;
|
|
62
|
-
/**
|
|
63
|
-
* Records a trace from given parameters. This provides a direct way to use trace without a need to
|
|
64
|
-
* start/stop. This is useful for use cases in which the trace cannot directly be used
|
|
65
|
-
* (e.g. if the duration was captured before the Performance SDK was loaded).
|
|
66
|
-
*
|
|
67
|
-
* @param startTime - trace start time since epoch in millisec.
|
|
68
|
-
* @param duration - The duration of the trace in millisec.
|
|
69
|
-
* @param options - An object which can optionally hold maps of custom metrics and
|
|
70
|
-
* custom attributes.
|
|
71
|
-
*/
|
|
72
|
-
record(startTime: number, duration: number, options?: {
|
|
73
|
-
metrics?: {
|
|
74
|
-
[key: string]: number;
|
|
75
|
-
};
|
|
76
|
-
attributes?: {
|
|
77
|
-
[key: string]: string;
|
|
78
|
-
};
|
|
79
|
-
}): void;
|
|
80
|
-
/**
|
|
81
|
-
* Adds to the value of a custom metric. If a custom metric with the provided name does not
|
|
82
|
-
* exist, it creates one with that name and the value equal to the given number. The value will be floored down to an
|
|
83
|
-
* integer.
|
|
84
|
-
*
|
|
85
|
-
* @param metricName - The name of the custom metric.
|
|
86
|
-
* @param num - The number to be added to the value of the custom metric. If not provided, it
|
|
87
|
-
* uses a default value of one.
|
|
88
|
-
*/
|
|
89
|
-
incrementMetric(metricName: string, num?: number): void;
|
|
90
|
-
/**
|
|
91
|
-
* Sets the value of the specified custom metric to the given number regardless of whether
|
|
92
|
-
* a metric with that name already exists on the trace instance or not. The value will be floored down to an
|
|
93
|
-
* integer.
|
|
94
|
-
*
|
|
95
|
-
* @param metricName - Name of the custom metric.
|
|
96
|
-
* @param num - Value to of the custom metric.
|
|
97
|
-
*/
|
|
98
|
-
putMetric(metricName: string, num: number): void;
|
|
99
|
-
/**
|
|
100
|
-
* Returns the value of the custom metric by that name. If a custom metric with that name does
|
|
101
|
-
* not exist will return zero.
|
|
102
|
-
*
|
|
103
|
-
* @param metricName - Name of the custom metric.
|
|
104
|
-
*/
|
|
105
|
-
getMetric(metricName: string): number;
|
|
106
|
-
/**
|
|
107
|
-
* Set a custom attribute of a trace to a certain value.
|
|
108
|
-
*
|
|
109
|
-
* @param attr - Name of the custom attribute.
|
|
110
|
-
* @param value - Value of the custom attribute.
|
|
111
|
-
*/
|
|
112
|
-
putAttribute(attr: string, value: string): void;
|
|
113
|
-
/**
|
|
114
|
-
* Retrieves the value which a custom attribute is set to.
|
|
115
|
-
*
|
|
116
|
-
* @param attr - Name of the custom attribute.
|
|
117
|
-
*/
|
|
118
|
-
getAttribute(attr: string): string | undefined;
|
|
119
|
-
/**
|
|
120
|
-
* Removes the specified custom attribute from a trace instance.
|
|
121
|
-
*
|
|
122
|
-
* @param attr - Name of the custom attribute.
|
|
123
|
-
*/
|
|
124
|
-
removeAttribute(attr: string): void;
|
|
125
|
-
/**
|
|
126
|
-
* Returns a map of all custom attributes of a trace instance.
|
|
127
|
-
*/
|
|
128
|
-
getAttributes(): {
|
|
129
|
-
[key: string]: string;
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
declare module '@firebase/component' {
|
|
133
|
-
interface NameServiceMapping {
|
|
134
|
-
'performance': FirebasePerformance;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { FirebaseApp } from '@firebase/app';
|
|
18
|
+
/**
|
|
19
|
+
* Defines configuration options for the Performance Monitoring SDK.
|
|
20
|
+
*
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
export interface PerformanceSettings {
|
|
24
|
+
/** Whether to collect custom events. */
|
|
25
|
+
dataCollectionEnabled?: boolean;
|
|
26
|
+
/** Whether to collect out of the box events. */
|
|
27
|
+
instrumentationEnabled?: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The Firebase Performance Monitoring service interface.
|
|
31
|
+
*
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
34
|
+
export interface FirebasePerformance {
|
|
35
|
+
/**
|
|
36
|
+
* The {@link @firebase/app#FirebaseApp} this `FirebasePerformance` instance is associated with.
|
|
37
|
+
*/
|
|
38
|
+
app: FirebaseApp;
|
|
39
|
+
/**
|
|
40
|
+
* Controls the logging of automatic traces and HTTP/S network monitoring.
|
|
41
|
+
*/
|
|
42
|
+
instrumentationEnabled: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Controls the logging of custom traces.
|
|
45
|
+
*/
|
|
46
|
+
dataCollectionEnabled: boolean;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The interface representing a `Trace`.
|
|
50
|
+
*
|
|
51
|
+
* @public
|
|
52
|
+
*/
|
|
53
|
+
export interface PerformanceTrace {
|
|
54
|
+
/**
|
|
55
|
+
* Starts the timing for the trace instance.
|
|
56
|
+
*/
|
|
57
|
+
start(): void;
|
|
58
|
+
/**
|
|
59
|
+
* Stops the timing of the trace instance and logs the data of the instance.
|
|
60
|
+
*/
|
|
61
|
+
stop(): void;
|
|
62
|
+
/**
|
|
63
|
+
* Records a trace from given parameters. This provides a direct way to use trace without a need to
|
|
64
|
+
* start/stop. This is useful for use cases in which the trace cannot directly be used
|
|
65
|
+
* (e.g. if the duration was captured before the Performance SDK was loaded).
|
|
66
|
+
*
|
|
67
|
+
* @param startTime - trace start time since epoch in millisec.
|
|
68
|
+
* @param duration - The duration of the trace in millisec.
|
|
69
|
+
* @param options - An object which can optionally hold maps of custom metrics and
|
|
70
|
+
* custom attributes.
|
|
71
|
+
*/
|
|
72
|
+
record(startTime: number, duration: number, options?: {
|
|
73
|
+
metrics?: {
|
|
74
|
+
[key: string]: number;
|
|
75
|
+
};
|
|
76
|
+
attributes?: {
|
|
77
|
+
[key: string]: string;
|
|
78
|
+
};
|
|
79
|
+
}): void;
|
|
80
|
+
/**
|
|
81
|
+
* Adds to the value of a custom metric. If a custom metric with the provided name does not
|
|
82
|
+
* exist, it creates one with that name and the value equal to the given number. The value will be floored down to an
|
|
83
|
+
* integer.
|
|
84
|
+
*
|
|
85
|
+
* @param metricName - The name of the custom metric.
|
|
86
|
+
* @param num - The number to be added to the value of the custom metric. If not provided, it
|
|
87
|
+
* uses a default value of one.
|
|
88
|
+
*/
|
|
89
|
+
incrementMetric(metricName: string, num?: number): void;
|
|
90
|
+
/**
|
|
91
|
+
* Sets the value of the specified custom metric to the given number regardless of whether
|
|
92
|
+
* a metric with that name already exists on the trace instance or not. The value will be floored down to an
|
|
93
|
+
* integer.
|
|
94
|
+
*
|
|
95
|
+
* @param metricName - Name of the custom metric.
|
|
96
|
+
* @param num - Value to of the custom metric.
|
|
97
|
+
*/
|
|
98
|
+
putMetric(metricName: string, num: number): void;
|
|
99
|
+
/**
|
|
100
|
+
* Returns the value of the custom metric by that name. If a custom metric with that name does
|
|
101
|
+
* not exist will return zero.
|
|
102
|
+
*
|
|
103
|
+
* @param metricName - Name of the custom metric.
|
|
104
|
+
*/
|
|
105
|
+
getMetric(metricName: string): number;
|
|
106
|
+
/**
|
|
107
|
+
* Set a custom attribute of a trace to a certain value.
|
|
108
|
+
*
|
|
109
|
+
* @param attr - Name of the custom attribute.
|
|
110
|
+
* @param value - Value of the custom attribute.
|
|
111
|
+
*/
|
|
112
|
+
putAttribute(attr: string, value: string): void;
|
|
113
|
+
/**
|
|
114
|
+
* Retrieves the value which a custom attribute is set to.
|
|
115
|
+
*
|
|
116
|
+
* @param attr - Name of the custom attribute.
|
|
117
|
+
*/
|
|
118
|
+
getAttribute(attr: string): string | undefined;
|
|
119
|
+
/**
|
|
120
|
+
* Removes the specified custom attribute from a trace instance.
|
|
121
|
+
*
|
|
122
|
+
* @param attr - Name of the custom attribute.
|
|
123
|
+
*/
|
|
124
|
+
removeAttribute(attr: string): void;
|
|
125
|
+
/**
|
|
126
|
+
* Returns a map of all custom attributes of a trace instance.
|
|
127
|
+
*/
|
|
128
|
+
getAttributes(): {
|
|
129
|
+
[key: string]: string;
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
declare module '@firebase/component' {
|
|
133
|
+
interface NameServiceMapping {
|
|
134
|
+
'performance': FirebasePerformance;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2020 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
import { PerformanceController } from '../controllers/perf';
|
|
18
|
-
export declare const enum HttpMethod {
|
|
19
|
-
HTTP_METHOD_UNKNOWN = 0,
|
|
20
|
-
GET = 1,
|
|
21
|
-
PUT = 2,
|
|
22
|
-
POST = 3,
|
|
23
|
-
DELETE = 4,
|
|
24
|
-
HEAD = 5,
|
|
25
|
-
PATCH = 6,
|
|
26
|
-
OPTIONS = 7,
|
|
27
|
-
TRACE = 8,
|
|
28
|
-
CONNECT = 9
|
|
29
|
-
}
|
|
30
|
-
export interface NetworkRequest {
|
|
31
|
-
performanceController: PerformanceController;
|
|
32
|
-
url: string;
|
|
33
|
-
httpMethod?: HttpMethod;
|
|
34
|
-
requestPayloadBytes?: number;
|
|
35
|
-
responsePayloadBytes?: number;
|
|
36
|
-
httpResponseCode?: number;
|
|
37
|
-
responseContentType?: string;
|
|
38
|
-
startTimeUs?: number;
|
|
39
|
-
timeToRequestCompletedUs?: number;
|
|
40
|
-
timeToResponseInitiatedUs?: number;
|
|
41
|
-
timeToResponseCompletedUs?: number;
|
|
42
|
-
}
|
|
43
|
-
export declare function createNetworkRequestEntry(performanceController: PerformanceController, entry: PerformanceEntry): void;
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { PerformanceController } from '../controllers/perf';
|
|
18
|
+
export declare const enum HttpMethod {
|
|
19
|
+
HTTP_METHOD_UNKNOWN = 0,
|
|
20
|
+
GET = 1,
|
|
21
|
+
PUT = 2,
|
|
22
|
+
POST = 3,
|
|
23
|
+
DELETE = 4,
|
|
24
|
+
HEAD = 5,
|
|
25
|
+
PATCH = 6,
|
|
26
|
+
OPTIONS = 7,
|
|
27
|
+
TRACE = 8,
|
|
28
|
+
CONNECT = 9
|
|
29
|
+
}
|
|
30
|
+
export interface NetworkRequest {
|
|
31
|
+
performanceController: PerformanceController;
|
|
32
|
+
url: string;
|
|
33
|
+
httpMethod?: HttpMethod;
|
|
34
|
+
requestPayloadBytes?: number;
|
|
35
|
+
responsePayloadBytes?: number;
|
|
36
|
+
httpResponseCode?: number;
|
|
37
|
+
responseContentType?: string;
|
|
38
|
+
startTimeUs?: number;
|
|
39
|
+
timeToRequestCompletedUs?: number;
|
|
40
|
+
timeToResponseInitiatedUs?: number;
|
|
41
|
+
timeToResponseCompletedUs?: number;
|
|
42
|
+
}
|
|
43
|
+
export declare function createNetworkRequestEntry(performanceController: PerformanceController, entry: PerformanceEntry): void;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2020 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
import '../../test/setup';
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import '../../test/setup';
|