summaryrefslogtreecommitdiffstats
path: root/examples/perf-bench/perf-bench.go
diff options
context:
space:
mode:
authorOndrej Fabry <ofabry@cisco.com>2019-09-17 12:41:47 +0200
committerOndrej Fabry <ofabry@cisco.com>2019-10-03 12:54:22 +0200
commit809b69ea4a90455445c34bbad7d8e5fea5cf3462 (patch)
treeba4b94339ac83908e2d9933692dc373929380aa7 /examples/perf-bench/perf-bench.go
parent48198748bdfcc7d30c794cdac19de822da53f840 (diff)
Optimizations for statsclient
- this dramatically improves performance for stats data collection - memory allocation is now done only when stat dirs change - updating prepared stat dir does not need to allocate memory - created integration test for testing stats client - added NumWorkerThreads and VectorRatePerWorker to SystemStats - added ReduceSimpleCounterStatIndex, ReduceCombinedCounterStatIndex for aggregating specific index Change-Id: I702731a69024ab5dd0832bb5cfe2773a987359e5 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Diffstat (limited to 'examples/perf-bench/perf-bench.go')
-rw-r--r--examples/perf-bench/perf-bench.go16
1 files changed, 6 insertions, 10 deletions
diff --git a/examples/perf-bench/perf-bench.go b/examples/perf-bench/perf-bench.go
index b246e6c..f48c154 100644
--- a/examples/perf-bench/perf-bench.go
+++ b/examples/perf-bench/perf-bench.go
@@ -25,9 +25,8 @@ import (
"github.com/pkg/profile"
"github.com/sirupsen/logrus"
- "git.fd.io/govpp.git/adapter"
"git.fd.io/govpp.git/adapter/socketclient"
- "git.fd.io/govpp.git/adapter/vppapiclient"
+ "git.fd.io/govpp.git/adapter/statsclient"
"git.fd.io/govpp.git/api"
"git.fd.io/govpp.git/core"
"git.fd.io/govpp.git/examples/binapi/vpe"
@@ -40,10 +39,12 @@ const (
func main() {
// parse optional flags
- var sync, prof, sock bool
+ var sync, prof bool
var cnt int
+ var sock string
flag.BoolVar(&sync, "sync", false, "run synchronous perf test")
- flag.BoolVar(&sock, "sock", false, "use socket client for VPP API")
+ flag.StringVar(&sock, "socket", socketclient.DefaultSocketName, "Path to VPP API socket")
+ flag.String("socket", statsclient.DefaultSocketName, "Path to VPP stats socket")
flag.IntVar(&cnt, "count", 0, "count of requests to be sent to VPP")
flag.BoolVar(&prof, "prof", false, "generate profile data")
flag.Parse()
@@ -61,12 +62,7 @@ func main() {
defer profile.Start().Stop()
}
- var a adapter.VppAPI
- if sock {
- a = socketclient.NewVppClient("/run/vpp-api.sock")
- } else {
- a = vppapiclient.NewVppClient("")
- }
+ a := socketclient.NewVppClient(sock)
// connect to VPP
conn, err := core.Connect(a)