mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2026-01-31 04:46:27 +00:00
Add prometheus metrics at /api/v1/metrics
This commit is contained in:
committed by
Mateusz Bączek
parent
1c0b4205d4
commit
4d410d124f
@@ -225,3 +225,11 @@ def get_playback_statistic
|
||||
|
||||
return tracker.as(Hash(String, Int64 | Float64))
|
||||
end
|
||||
|
||||
def to_prometheus_metrics(metrics_struct : Hash(String, Number)) : String
|
||||
return String.build do |str|
|
||||
metrics_struct.each.each do |key, value|
|
||||
str << key << " " << value << "\n"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user