diff options
| author | pg9182 <96569817+pg9182@users.noreply.github.com> | 2022-10-19 00:09:05 -0400 |
|---|---|---|
| committer | pg9182 <96569817+pg9182@users.noreply.github.com> | 2022-10-19 00:09:05 -0400 |
| commit | a2a99f900ec81142a946e7d5a4487a5d1d045d47 (patch) | |
| tree | 8a9bd4b362b347a0c387ac59b66fece876d45449 /pkg/api/api0 | |
| parent | b660f27267ed5f6387c53bcb7539c8117640550c (diff) | |
| download | Atlas-a2a99f900ec81142a946e7d5a4487a5d1d045d47.tar.gz Atlas-a2a99f900ec81142a946e7d5a4487a5d1d045d47.zip | |
pkg/api/api0: Implement ServerList WritePrometheus
Diffstat (limited to 'pkg/api/api0')
| -rw-r--r-- | pkg/api/api0/serverlist.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/api/api0/serverlist.go b/pkg/api/api0/serverlist.go index 561acbe..2587f8b 100644 --- a/pkg/api/api0/serverlist.go +++ b/pkg/api/api0/serverlist.go @@ -572,6 +572,11 @@ func (s *ServerList) GetMetrics() []byte { return b.Bytes() } +// WritePrometheus writes metrics for s to w. +func (s *ServerList) WritePrometheus(w io.Writer) { + w.Write(s.GetMetrics()) +} + // GetLiveServers loops over live (i.e., not dead/ghost) servers until fn // returns false. The order of the servers is non-deterministic. func (s *ServerList) GetLiveServers(fn func(*Server) bool) { |
