summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/stats-api/README.md2
-rw-r--r--examples/stats-api/stats_api.go12
2 files changed, 7 insertions, 7 deletions
diff --git a/examples/stats-api/README.md b/examples/stats-api/README.md
index 5511bf4..f3d33b1 100644
--- a/examples/stats-api/README.md
+++ b/examples/stats-api/README.md
@@ -6,7 +6,7 @@ This example demonstrates how to retrieve statistics from VPP using [the new Sta
The following requirements are required to run this example:
-- install **VPP 18.10+** (VPP 19.04+ for goclient)
+- install VPP **18.10+** (VPP 19.04+ for statsclient)
- enable stats in VPP
To enable stats add following section to you VPP config:
diff --git a/examples/stats-api/stats_api.go b/examples/stats-api/stats_api.go
index a42e3d2..175bb27 100644
--- a/examples/stats-api/stats_api.go
+++ b/examples/stats-api/stats_api.go
@@ -35,10 +35,9 @@ import (
// ------------------------------------------------------------------
var (
- statsSocket = flag.String("socket", adapter.DefaultStatsSocket, "Path to VPP stats socket")
+ statsSocket = flag.String("socket", statsclient.DefaultSocketName, "Path to VPP stats socket")
dumpAll = flag.Bool("all", false, "Dump all stats including ones with zero values")
-
- goclient = flag.Bool("goclient", false, "Use pure Go client for stats API")
+ oldclient = flag.Bool("oldclient", false, "Use old client for stats API (vppapiclient)")
)
func init() {
@@ -66,10 +65,10 @@ func main() {
}
var client adapter.StatsAPI
- if *goclient {
- client = statsclient.NewStatsClient(*statsSocket)
- } else {
+ if *oldclient {
client = vppapiclient.NewStatClient(*statsSocket)
+ } else {
+ client = statsclient.NewStatsClient(*statsSocket)
}
fmt.Printf("Connecting to stats socket: %s\n", *statsSocket)
@@ -138,6 +137,7 @@ func main() {
case "dump":
dumpStats(client, patterns, skipZeros)
+
default:
listStats(client, patterns)
}