Recognize stat_dir_type_empty
[govpp.git] / proxy / client.go
index 7f92946..aea9a94 100644 (file)
@@ -16,12 +16,12 @@ package proxy
 
 import (
        "fmt"
-       "git.fd.io/govpp.git/core"
        "net/rpc"
        "reflect"
        "time"
 
        "git.fd.io/govpp.git/api"
+       "git.fd.io/govpp.git/core"
 )
 
 type Client struct {
@@ -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