|
| 1 | +import { Request, Response, NextFunction } from 'express'; |
| 2 | +import { StandardMetrics } from './standard_metrics'; |
| 3 | +import { ResolverMetricLabels } from './metrics/resolver_metric'; |
| 4 | +import { ApiMetricLabels } from './metrics/api_metric'; |
| 5 | +import { HttpMiddlewareMetricConfig } from './metrics/middleware_metric'; |
| 6 | +import { CallMetricLabels } from './metrics/call_metric'; |
| 7 | +import { DatabaseMetricLabels } from './metrics/database_metric'; |
| 8 | +import { Client } from './client'; |
| 9 | +export interface MetricsImpl extends StandardMetrics { |
| 10 | + Histogram(name: string, value: number, labels: Record<string, string>): void; |
| 11 | + Count(name: string, labels: Record<string, string>): void; |
| 12 | + Gauge(name: string, value: number, labels: Record<string, string>): void; |
| 13 | + Summary(name: string, value: number, labels: Record<string, string>): void; |
| 14 | +} |
| 15 | +export declare class Metrics implements MetricsImpl { |
| 16 | + private static instance; |
| 17 | + private readonly client; |
| 18 | + private constructor(); |
| 19 | + static getInstance(client: Client): Metrics; |
| 20 | + Histogram(name: string, value: number, labels: Record<string, string>): void; |
| 21 | + Count(name: string, labels: Record<string, string>): void; |
| 22 | + Gauge(name: string, value: number, labels: Record<string, string>): void; |
| 23 | + Summary(name: string, value: number, labels: Record<string, string>): void; |
| 24 | + ResolverMetric(value: number, labels: ResolverMetricLabels): void; |
| 25 | + ApiMetric(value: number, labels: ApiMetricLabels): void; |
| 26 | + HttpMiddlewareMetric(config: HttpMiddlewareMetricConfig): (req: Request, res: Response, next: NextFunction) => void; |
| 27 | + CallMetric(value: number, labels: CallMetricLabels): void; |
| 28 | + DatabaseMetric(value: number, labels: DatabaseMetricLabels): void; |
| 29 | +} |
0 commit comments