UNPKG

@sentry/core

Version:
63 lines (53 loc) 1.5 kB
import { MetricsAggregator } from './aggregator.js'; import { metrics } from './exports.js'; /** * Adds a value to a counter metric * * @experimental This API is experimental and might have breaking changes in the future. */ function increment(name, value = 1, data) { metrics.increment(MetricsAggregator, name, value, data); } /** * Adds a value to a distribution metric * * @experimental This API is experimental and might have breaking changes in the future. */ function distribution(name, value, data) { metrics.distribution(MetricsAggregator, name, value, data); } /** * Adds a value to a set metric. Value must be a string or integer. * * @experimental This API is experimental and might have breaking changes in the future. */ function set(name, value, data) { metrics.set(MetricsAggregator, name, value, data); } /** * Adds a value to a gauge metric * * @experimental This API is experimental and might have breaking changes in the future. */ function gauge(name, value, data) { metrics.gauge(MetricsAggregator, name, value, data); } /** * Returns the metrics aggregator for a given client. */ function getMetricsAggregatorForClient(client) { return metrics.getMetricsAggregatorForClient(client, MetricsAggregator); } const metricsDefault = { increment, distribution, set, gauge, /** * @ignore This is for internal use only. */ getMetricsAggregatorForClient, }; export { metricsDefault }; //# sourceMappingURL=exports-default.js.map