grafana-cloud-graphite
Version:
NodeJS client for Grafana Cloud Graphite API
18 lines (17 loc) • 841 B
TypeScript
/// <reference types="node" />
import { Counter, Gauge, GraphiteMetricsOptions, Stats } from "../types";
import EventEmitter from "events";
export declare class GraphiteMetrics extends EventEmitter {
private options;
private readonly httpHandler;
private metricsStore;
private intervalHandlers;
constructor(options: GraphiteMetricsOptions);
registerCounter(name: string, interval: number, tags?: Record<string, string>): Counter;
registerStats(name: string, interval: number, tags?: Record<string, string>): Stats;
sendMetric(name: string, interval: number, value: number, time?: number, tags?: Record<string, string>): Promise<void>;
registerGauge(name: string, interval: number, tags?: Record<string, string>): Gauge;
stop(): void;
private registerMetric;
private registerIntervalHandler;
}