File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,25 @@ const firebaseApp = initializeApp({
10
10
} ) ;
11
11
const perf = getInstance ( firebaseApp ) ;
12
12
13
+ function intialize ( ) {
14
+ // [START perf_initialize]
15
+ const { initializeApp } = require ( "firebase/app" ) ;
16
+ const { getPerformance } = require ( "firebase/performance" ) ;
17
+
18
+ // TODO: Replace the following with your app's Firebase project configuration
19
+ // See: https://firebase.google.com/docs/web/setup#config-object
20
+ const firebaseConfig = {
21
+ // ...
22
+ } ;
23
+
24
+ // Initialize Firebase
25
+ const app = initializeApp ( firebaseConfig ) ;
26
+
27
+ // Initialize Performance Monitoring and get a reference to the service
28
+ const perf = getPerformance ( app ) ;
29
+ // [END perf_initialize]
30
+ }
31
+
13
32
export function getInstance ( firebaseApp ) {
14
33
// [START perf_get_instance]
15
34
const { getPerformance } = require ( "firebase/performance" ) ;
Original file line number Diff line number Diff line change @@ -3,6 +3,22 @@ import "firebase/performance";
3
3
4
4
const perf = firebase . performance ( ) ;
5
5
6
+ function intialize ( ) {
7
+ // [START perf_initialize]
8
+ // TODO: Replace the following with your app's Firebase project configuration
9
+ // See: https://firebase.google.com/docs/web/setup#config-object
10
+ var firebaseConfig = {
11
+ // ...
12
+ } ;
13
+
14
+ // Initialize Firebase
15
+ firebase . initializeApp ( firebaseConfig ) ;
16
+
17
+ // Initialize Performance Monitoring and get a reference to the service
18
+ var perf = firebase . performance ( ) ;
19
+ // [END perf_initialize]
20
+ }
21
+
6
22
function addCustomTrace ( ) {
7
23
// [START perf_add_custom_trace]
8
24
const trace = perf . trace ( "CUSTOM_TRACE_NAME" ) ;
You can’t perform that action at this time.
0 commit comments