From b74e3b37479a7fa763bed1f2c76de612ee51dcbc Mon Sep 17 00:00:00 2001 From: Vladimir Lavor Date: Thu, 29 Oct 2020 12:56:24 +0100 Subject: Stats API: added GetMemory() Retrieved numbers relate to the statseg heap. Change-Id: I72750183db3524481918c71c993b39e65c28ddb6 Signed-off-by: Vladimir Lavor --- proxy/client.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'proxy/client.go') diff --git a/proxy/client.go b/proxy/client.go index 6f29c71..aea9a94 100644 --- a/proxy/client.go +++ b/proxy/client.go @@ -117,6 +117,16 @@ func (s *StatsClient) GetBufferStats(bufStats *api.BufferStats) error { return nil } +func (s *StatsClient) GetMemoryStats(memStats *api.MemoryStats) error { + req := StatsRequest{StatsType: "memory"} + resp := StatsResponse{MemStats: new(api.MemoryStats)} + if err := s.rpc.Call("StatsRPC.GetStats", req, &resp); err != nil { + return err + } + *memStats = *resp.MemStats + return nil +} + type BinapiClient struct { rpc *rpc.Client timeout time.Duration -- cgit 1.2.3-korg