diff options
author | Ondrej Fabry <ofabry@cisco.com> | 2019-06-20 18:52:30 +0200 |
---|---|---|
committer | Ondrej Fabry <ofabry@cisco.com> | 2019-06-20 18:52:30 +0200 |
commit | da15c397b3dbbba07d159b3af767aa13d443cfd6 (patch) | |
tree | 284e4207377df3c0952656d4f75459a96d0ecb36 /examples | |
parent | 682250e328472e855a4c59e9e5f004473b6af0d3 (diff) |
Add statsclient - pure Go implementation for stats API
Change-Id: Ia5bab652c6089378697459f477f9060dc7a53e90
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/stats-api/stats_api.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/examples/stats-api/stats_api.go b/examples/stats-api/stats_api.go index f74a055..e20ce7a 100644 --- a/examples/stats-api/stats_api.go +++ b/examples/stats-api/stats_api.go @@ -22,6 +22,7 @@ import ( "strings" "git.fd.io/govpp.git/adapter" + "git.fd.io/govpp.git/adapter/statsclient" "git.fd.io/govpp.git/adapter/vppapiclient" "git.fd.io/govpp.git/core" ) @@ -34,7 +35,8 @@ import ( // ------------------------------------------------------------------ var ( - statsSocket = flag.String("socket", vppapiclient.DefaultStatSocket, "VPP stats segment socket") + statsSocket = flag.String("socket", adapter.DefaultStatsSocket, "Path to VPP stats socket") + goclient = flag.Bool("goclient", true, "Use pure Go client for stats API") dumpAll = flag.Bool("all", false, "Dump all stats including ones with zero values") ) @@ -62,7 +64,12 @@ func main() { patterns = flag.Args()[1:] } - client := vppapiclient.NewStatClient(*statsSocket) + var client adapter.StatsAPI + if *goclient { + client = statsclient.NewStatsClient(*statsSocket) + } else { + client = vppapiclient.NewStatClient(*statsSocket) + } fmt.Printf("Connecting to stats socket: %s\n", *statsSocket) |