Skip to content

Commit

Permalink
Reinstate refresh as a public method
Browse files Browse the repository at this point in the history
  • Loading branch information
Half-Shot committed Jan 25, 2021
1 parent 266e8ad commit 51846f4
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/components/prometheusmetrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,18 @@ export class PrometheusMetrics {
});
}

/**
* Fetch metrics from all configured collectors
*/
public async refresh () {
try {
await Promise.all(this.collectors.map((f) => f()));
}
catch (ex) {
log.warn(`Failed to refresh metrics:`, ex);
}
}

/**
* Registers some exported metrics that expose counts of various kinds of
* objects within the bridge.
Expand Down Expand Up @@ -396,13 +408,4 @@ export class PrometheusMetrics {
},
});
}

private async refresh () {
try {
await Promise.all(this.collectors.map((f) => f()));
}
catch (ex) {
log.warn(`Failed to refresh metrics:`, ex);
}
}
}

0 comments on commit 51846f4

Please sign in to comment.