UNPKG

realm-object-server

Version:

Realm Object Server

22 lines 755 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var MetricType; (function (MetricType) { MetricType["Counter"] = "c"; MetricType["Gauge"] = "g"; MetricType["Histogram"] = "ms"; })(MetricType = exports.MetricType || (exports.MetricType = {})); function parseMetricName(metric) { const nameParts = metric.name.split("."); const realmPart = nameParts.shift(); if (realmPart !== "realm") { throw new Error(`Skipping metric named "${metric.name}", it must start with "realm."`); } const host = nameParts.shift(); if (!host) { throw new Error("Expected a host"); } return nameParts.join("_"); } exports.parseMetricName = parseMetricName; //# sourceMappingURL=Statsd.js.map