diff options
| author | JP Dillingham <jp@dillingham.me> | 2022-08-25 20:30:25 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2022-08-25 20:30:25 -0500 |
| commit | 75c96b1d5ffef182428fa752507e6fe7a1b5a338 (patch) | |
| tree | 21a08c3bcddc8026192bc03893694ebef980b495 | |
| parent | b82b84d955d403aab4e9da1ea1fc68e08c54dbbb (diff) | |
| download | slskd-75c96b1d5ffef182428fa752507e6fe7a1b5a338.tar.gz | |
stub metrics
| -rw-r--r-- | src/slskd/Core/Metrics.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/slskd/Core/Metrics.cs b/src/slskd/Core/Metrics.cs new file mode 100644 index 00000000..51fc75db --- /dev/null +++ b/src/slskd/Core/Metrics.cs @@ -0,0 +1,18 @@ +using Prometheus; + +namespace slskd +{ + public static class Metrics + { + public static Histogram SearchResponseLatency { get; } = Prometheus.Metrics + .CreateHistogram("slskd_search_response_latency", "Histogram of received order values (in USD).", + new HistogramConfiguration + { + // We divide measurements in 10 buckets of $100 each, up to $1000. + Buckets = Histogram.ExponentialBuckets(1, 2, 10), + }); + + public static Counter SearchRequestsReceived { get; } = Prometheus.Metrics.CreateCounter("slskd_search_requests_received", "total number of search requests"); + public static Counter SearchResponsesSent { get; } = Prometheus.Metrics.CreateCounter("slskd_search_responses_sent", "total number of search responses sent"); + } +} |
