@react-native-firebase/perf 24.1.1 → 25.0.0
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/CHANGELOG.md +25 -0
- package/dist/module/HttpMetric.js +91 -0
- package/dist/module/HttpMetric.js.map +1 -0
- package/dist/module/MetricWithAttributes.js +51 -0
- package/dist/module/MetricWithAttributes.js.map +1 -0
- package/{lib → dist/module}/ScreenTrace.js +3 -6
- package/dist/module/ScreenTrace.js.map +1 -0
- package/{lib → dist/module}/Trace.js +8 -23
- package/dist/module/Trace.js.map +1 -0
- package/dist/module/index.js +23 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/modular.js +93 -0
- package/dist/module/modular.js.map +1 -0
- package/{lib/index.js → dist/module/namespaced.js} +28 -72
- package/dist/module/namespaced.js.map +1 -0
- package/dist/module/package.json +1 -0
- package/dist/module/types/internal.js +4 -0
- package/dist/module/types/internal.js.map +1 -0
- package/dist/module/types/namespaced.js +65 -0
- package/dist/module/types/namespaced.js.map +1 -0
- package/dist/module/types/perf.js +4 -0
- package/dist/module/types/perf.js.map +1 -0
- package/dist/module/version.js +5 -0
- package/dist/module/version.js.map +1 -0
- package/dist/typescript/lib/HttpMetric.d.ts +21 -0
- package/dist/typescript/lib/HttpMetric.d.ts.map +1 -0
- package/dist/typescript/lib/MetricWithAttributes.d.ts +11 -0
- package/dist/typescript/lib/MetricWithAttributes.d.ts.map +1 -0
- package/dist/typescript/lib/ScreenTrace.d.ts +12 -0
- package/dist/typescript/lib/ScreenTrace.d.ts.map +1 -0
- package/dist/typescript/lib/Trace.d.ts +17 -0
- package/dist/typescript/lib/Trace.d.ts.map +1 -0
- package/dist/typescript/lib/index.d.ts +6 -0
- package/dist/typescript/lib/index.d.ts.map +1 -0
- package/dist/typescript/lib/modular.d.ts +43 -0
- package/dist/typescript/lib/modular.d.ts.map +1 -0
- package/dist/typescript/lib/namespaced.d.ts +11 -0
- package/dist/typescript/lib/namespaced.d.ts.map +1 -0
- package/dist/typescript/lib/types/internal.d.ts +45 -0
- package/dist/typescript/lib/types/internal.d.ts.map +1 -0
- package/dist/typescript/lib/types/namespaced.d.ts +128 -0
- package/dist/typescript/lib/types/namespaced.d.ts.map +1 -0
- package/dist/typescript/lib/types/perf.d.ts +72 -0
- package/dist/typescript/lib/types/perf.d.ts.map +1 -0
- package/dist/typescript/lib/version.d.ts +2 -0
- package/dist/typescript/lib/version.d.ts.map +1 -0
- package/dist/typescript/package.json +1 -0
- package/lib/{HttpMetric.js → HttpMetric.ts} +21 -8
- package/lib/{MetricWithAttributes.js → MetricWithAttributes.ts} +14 -4
- package/lib/ScreenTrace.ts +59 -0
- package/lib/Trace.ts +112 -0
- package/lib/index.ts +25 -0
- package/lib/modular.ts +116 -0
- package/lib/namespaced.ts +200 -0
- package/lib/types/internal.ts +80 -0
- package/lib/types/namespaced.ts +162 -0
- package/lib/types/perf.ts +99 -0
- package/lib/version.ts +2 -0
- package/package.json +40 -8
- package/plugin/tsconfig.json +2 -1
- package/plugin/tsconfig.tsbuildinfo +1 -1
- package/tsconfig.json +20 -0
- package/typedoc.json +2 -2
- package/lib/index.d.ts +0 -583
- package/lib/modular/index.d.ts +0 -89
- package/lib/modular/index.js +0 -103
- package/lib/version.js +0 -2
package/lib/modular/index.js
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this library except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @typedef {import('@firebase/app').FirebaseApp} FirebaseApp
|
|
20
|
-
* @typedef {import('..').FirebasePerformanceTypes.Module} Performance
|
|
21
|
-
* @typedef {import('..').FirebasePerformanceTypes.Trace} Trace
|
|
22
|
-
* @typedef {import('..').FirebasePerformanceTypes.ScreenTrace} ScreenTrace
|
|
23
|
-
* @typedef {import('..').FirebasePerformanceTypes.HttpMetric} HttpMetric
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
import { getApp } from '@react-native-firebase/app';
|
|
27
|
-
|
|
28
|
-
import { MODULAR_DEPRECATION_ARG } from '@react-native-firebase/app/dist/module/common';
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Returns a Performance instance for the given app.
|
|
32
|
-
* @param app - FirebaseApp. Optional.
|
|
33
|
-
* @returns {Performance}
|
|
34
|
-
*/
|
|
35
|
-
export function getPerformance(app) {
|
|
36
|
-
if (app) {
|
|
37
|
-
return getApp(app.name).perf();
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return getApp().perf();
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Returns a Performance instance for the given app.
|
|
45
|
-
* @param app - FirebaseApp. Required.
|
|
46
|
-
* @param settings - Optional PerformanceSettings. Set "dataCollectionEnabled" which will enable/disable Performance collection.
|
|
47
|
-
* @returns {Performance}
|
|
48
|
-
*/
|
|
49
|
-
export async function initializePerformance(app, settings) {
|
|
50
|
-
const perf = getApp(app.name).perf();
|
|
51
|
-
|
|
52
|
-
if (settings && settings.dataCollectionEnabled !== undefined) {
|
|
53
|
-
perf.dataCollectionEnabled = settings.dataCollectionEnabled;
|
|
54
|
-
}
|
|
55
|
-
if (settings && settings.instrumentationEnabled !== undefined) {
|
|
56
|
-
perf.instrumentationEnabled = settings.instrumentationEnabled;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return perf;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Returns a Trace instance.
|
|
64
|
-
* @param perf - Performance instance
|
|
65
|
-
* @param identifier - A String to identify the Trace instance
|
|
66
|
-
* @returns {Trace}
|
|
67
|
-
*/
|
|
68
|
-
export function trace(perf, identifier) {
|
|
69
|
-
return perf.newTrace.call(perf, identifier, MODULAR_DEPRECATION_ARG);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Returns a HttpMetric instance.
|
|
74
|
-
* @param perf - Performance instance
|
|
75
|
-
* @param identifier - A String to identify the HttpMetric instance
|
|
76
|
-
* @returns {HttpMetric}
|
|
77
|
-
*/
|
|
78
|
-
export function httpMetric(perf, identifier, httpMethod) {
|
|
79
|
-
return perf.newHttpMetric.call(perf, identifier, httpMethod, MODULAR_DEPRECATION_ARG);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Creates a ScreenTrace instance with the given identifier.
|
|
84
|
-
* Throws if hardware acceleration is disabled or if Android is 9.0 or 9.1.
|
|
85
|
-
* @platform android Android !== 9.0.0 && Android !== 9.1.0
|
|
86
|
-
* @param perf - Performance instance
|
|
87
|
-
* @param identifier Name of the trace, no leading or trailing whitespace allowed, no leading underscore '_' character allowed, max length is 100.
|
|
88
|
-
* @returns {ScreenTrace}
|
|
89
|
-
*/
|
|
90
|
-
export function newScreenTrace(perf, identifier) {
|
|
91
|
-
return perf.newScreenTrace.call(perf, identifier, MODULAR_DEPRECATION_ARG);
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Creates a ScreenTrace instance with the given identifier and immediately starts it.
|
|
95
|
-
* Throws if hardware acceleration is disabled or if Android is 9.0 or 9.1.
|
|
96
|
-
* @platform android Android !== 9.0.0 && Android !== 9.1.0
|
|
97
|
-
* @param perf - Performance instance
|
|
98
|
-
* @param identifier Name of the screen
|
|
99
|
-
* @returns {Promise<ScreenTrace>}
|
|
100
|
-
*/
|
|
101
|
-
export function startScreenTrace(perf, identifier) {
|
|
102
|
-
return perf.startScreenTrace.call(perf, identifier, MODULAR_DEPRECATION_ARG);
|
|
103
|
-
}
|
package/lib/version.js
DELETED