MCPcopy Create free account
hub / github.com/NativeScript/firebase / Trace

Class Trace

packages/firebase-performance/index.android.ts:68–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68export class Trace implements ITrace {
69 _native: com.google.firebase.perf.metrics.Trace;
70 static fromNative(trace: com.google.firebase.perf.metrics.Trace) {
71 if (trace instanceof com.google.firebase.perf.metrics.Trace) {
72 const result = new Trace();
73 result._native = trace;
74 return result;
75 }
76 return null;
77 }
78 get native() {
79 return this._native;
80 }
81 get android() {
82 return this.native;
83 }
84
85 getAttribute(attribute: string): string {
86 return this.native.getAttribute(attribute);
87 }
88 getMetric(metricName: string): number {
89 return this.native.getLongMetric(metricName);
90 }
91 getMetrics(): { [key: string]: number } {
92 return deserialize(this.native.getAttributes());
93 }
94 incrementMetric(metricName: string, incrementBy: number): void {
95 this.native.incrementMetric(metricName, incrementBy);
96 }
97 putAttribute(attribute: string, value: string): void {
98 this.native.putAttribute(attribute, value);
99 }
100 putMetric(metricName: string, value: number): void {
101 this.native.putMetric(metricName, value);
102 }
103 removeMetric(metricName: string): void {
104 this.native.removeAttribute(metricName);
105 }
106 start() {
107 this.native.start();
108 }
109 stop() {
110 this.native.stop();
111 }
112}
113
114export class Performance implements IPerformance {
115 _native: com.google.firebase.perf.FirebasePerformance;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected