Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
{"version":3,"file":"metrics.js","sources":["../../../src/metrics.ts"],"sourcesContent":["import { BrowserMetricsAggregator, metrics as metricsCore } from '@sentry/core';\nimport type { DurationUnit, MetricData, Metrics } from '@sentry/types';\n\n/**\n * Adds a value to a counter metric\n *\n * @experimental This API is experimental and might have breaking changes in the future.\n */\nfunction increment(name: string, value: number = 1, data?: MetricData): void {\n metricsCore.increment(BrowserMetricsAggregator, name, value, data);\n}\n\n/**\n * Adds a value to a distribution metric\n *\n * @experimental This API is experimental and might have breaking changes in the future.\n */\nfunction distribution(name: string, value: number, data?: MetricData): void {\n metricsCore.distribution(BrowserMetricsAggregator, name, value, data);\n}\n\n/**\n * Adds a value to a set metric. Value must be a string or integer.\n *\n * @experimental This API is experimental and might have breaking changes in the future.\n */\nfunction set(name: string, value: number | string, data?: MetricData): void {\n metricsCore.set(BrowserMetricsAggregator, name, value, data);\n}\n\n/**\n * Adds a value to a gauge metric\n *\n * @experimental This API is experimental and might have breaking changes in the future.\n */\nfunction gauge(name: string, value: number, data?: MetricData): void {\n metricsCore.gauge(BrowserMetricsAggregator, name, value, data);\n}\n\n/**\n * Adds a timing metric.\n * The metric is added as a distribution metric.\n *\n * You can either directly capture a numeric `value`, or wrap a callback function in `timing`.\n * In the latter case, the duration of the callback execution will be captured as a span & a metric.\n *\n * @experimental This API is experimental and might have breaking changes in the future.\n */\nfunction timing(name: string, value: number, unit?: DurationUnit, data?: Omit): void;\nfunction timing(name: string, callback: () => T, unit?: DurationUnit, data?: Omit): T;\nfunction timing(\n name: string,\n value: number | (() => T),\n unit: DurationUnit = 'second',\n data?: Omit,\n): T | void {\n return metricsCore.timing(BrowserMetricsAggregator, name, value, unit, data);\n}\n\nexport const metrics: Metrics = {\n increment,\n distribution,\n set,\n gauge,\n timing,\n};\n"],"names":["metricsCore"],"mappings":";;AAGA;AACA;AACA;AACA;AACA;AACA,SA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