Code Review
/
govpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Stats API: added GetMemory()
[govpp.git]
/
proxy
/
server.go
diff --git
a/proxy/server.go
b/proxy/server.go
index
50a0077
..
21d8e1b
100644
(file)
--- a/
proxy/server.go
+++ b/
proxy/server.go
@@
-55,6
+55,7
@@
type StatsResponse struct {
IfaceStats *api.InterfaceStats
ErrStats *api.ErrorStats
BufStats *api.BufferStats
IfaceStats *api.InterfaceStats
ErrStats *api.ErrorStats
BufStats *api.BufferStats
+ MemStats *api.MemoryStats
}
// StatsRPC is a RPC server for proxying client request to api.StatsProvider.
}
// StatsRPC is a RPC server for proxying client request to api.StatsProvider.
@@
-200,6
+201,9
@@
func (s *StatsRPC) GetStats(req StatsRequest, resp *StatsResponse) error {
case "buffer":
resp.BufStats = new(api.BufferStats)
return s.statsConn.GetBufferStats(resp.BufStats)
case "buffer":
resp.BufStats = new(api.BufferStats)
return s.statsConn.GetBufferStats(resp.BufStats)
+ case "memory":
+ resp.MemStats = new(api.MemoryStats)
+ return s.statsConn.GetMemoryStats(resp.MemStats)
default:
return fmt.Errorf("unknown stats type: %s", req.StatsType)
}
default:
return fmt.Errorf("unknown stats type: %s", req.StatsType)
}