2017-05-24 17:02:41 +01:00
|
|
|
import { NativeModules } from 'react-native';
|
|
|
|
|
2017-05-24 12:37:52 +01:00
|
|
|
const FirebasePerformance = NativeModules.RNFirebasePerformance;
|
|
|
|
|
|
|
|
export default class Trace {
|
|
|
|
|
|
|
|
constructor(perf: Object, identifier: string) {
|
|
|
|
this.perf = perf;
|
|
|
|
this.identifier = identifier;
|
|
|
|
}
|
|
|
|
|
|
|
|
start() {
|
|
|
|
FirebasePerformance.start(this.identifier);
|
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
|
|
|
FirebasePerformance.stop(this.identifier);
|
|
|
|
}
|
|
|
|
|
|
|
|
incrementCounter(event: string) {
|
|
|
|
FirebasePerformance.incrementCounter(this.identifier, event);
|
|
|
|
}
|
|
|
|
}
|