Skip to content

Commit

Permalink
Rename variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbruens committed Oct 16, 2024
1 parent cc3ffe3 commit 5341e1a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/shadowbox/server/shared_metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,12 @@ export class PrometheusUsageMetrics implements UsageMetrics {

constructor(private prometheusClient: PrometheusClient) {}

private async queryUsage(metric: string, deltaSecs: number): Promise<PrometheusQueryResult> {
private async queryUsage(
timeSeriesSelector: string,
deltaSecs: number
): Promise<PrometheusQueryResult> {
const query = `
sum(increase(${metric}[${deltaSecs}s]))
sum(increase(${timeSeriesSelector}[${deltaSecs}s]))
by (${PROMETHEUS_COUNTRY_LABEL}, ${PROMETHEUS_ASN_LABEL})
`;
const queryResponse = await this.prometheusClient.query(query);
Expand Down

0 comments on commit 5341e1a

Please sign in to comment.