add -period flag
This commit is contained in:
4
main.go
4
main.go
@ -13,6 +13,8 @@ import (
|
||||
|
||||
func main() {
|
||||
addr := flag.String("agentx-addr", "localhost:705", "Address to connect to (hostname:port or Unix socket path)")
|
||||
vppStatsAddr := flag.String("vpp-stats-addr", "/var/run/vpp/stats.sock", "VPP stats socket path")
|
||||
period := flag.Float64("period", 10.0, "Interval in seconds for querying VPP interface stats")
|
||||
flag.Parse()
|
||||
|
||||
var network, address string
|
||||
@ -32,7 +34,7 @@ func main() {
|
||||
client.ReconnectInterval = 1 * time.Second
|
||||
|
||||
// Start VPP stats routine
|
||||
vppstats.StartStatsRoutine()
|
||||
vppstats.StartStatsRoutine(*vppStatsAddr, time.Duration(*period*1000)*time.Millisecond)
|
||||
|
||||
for {
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
|
Reference in New Issue
Block a user