react-native-firebase-compiled
Version:
A well tested, feature rich Firebase implementation for React Native, supporting iOS & Android. Individual module support for Admob, Analytics, Auth, Crash Reporting, Cloud Firestore, Database, Dynamic Links, Functions, Messaging (FCM), Remote Config, Sto
60 lines (43 loc) • 1.76 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _native = require("../../utils/native");
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
class Trace {
constructor(perf, identifier) {
_defineProperty(this, "identifier", void 0);
_defineProperty(this, "_perf", void 0);
this._perf = perf;
this.identifier = identifier;
}
getAttribute(attribute) {
return (0, _native.getNativeModule)(this._perf).getTraceAttribute(this.identifier, attribute);
}
getAttributes() {
return (0, _native.getNativeModule)(this._perf).getTraceAttributes(this.identifier);
}
getMetric(metricName) {
return (0, _native.getNativeModule)(this._perf).getTraceLongMetric(this.identifier, metricName);
}
incrementMetric(metricName, incrementBy) {
return (0, _native.getNativeModule)(this._perf).incrementTraceMetric(this.identifier, metricName, incrementBy);
}
putAttribute(attribute, value) {
return (0, _native.getNativeModule)(this._perf).putTraceAttribute(this.identifier, attribute, value);
}
putMetric(metricName, value) {
return (0, _native.getNativeModule)(this._perf).putTraceMetric(this.identifier, metricName, value);
}
removeAttribute(attribute) {
return (0, _native.getNativeModule)(this._perf).removeTraceAttribute(this.identifier, attribute);
}
start() {
return (0, _native.getNativeModule)(this._perf).startTrace(this.identifier);
}
stop() {
return (0, _native.getNativeModule)(this._perf).stopTrace(this.identifier);
}
}
exports.default = Trace;