Skip to content

Commit

Permalink
workload: add missing connect flags (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
andydunstall authored Nov 12, 2024
1 parent 11f8e93 commit 3cf9f5a
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions pikotest/workload/traffic/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,29 @@ func (c *ConnectConfig) Validate() error {
return nil
}

func (c *ConnectConfig) RegisterFlags(fs *pflag.FlagSet) {
fs.StringVar(
&c.URL,
"connect.url",
c.URL,
`
Piko server URL.
Note Piko connects to the server with WebSockets, so will replace http/https
with ws/wss (you can configure either).`,
)

fs.DurationVar(
&c.Timeout,
"connect.timeout",
c.Timeout,
`
Timeout attempting to connect to the Piko server on boot. Note if the agent
is disconnected after the initial connection succeeds it will keep trying to
reconnect.`,
)
}

type Config struct {
Protocol string `json:"protocol" yaml:"protocol"`

Expand Down Expand Up @@ -82,15 +105,15 @@ Upstream listener protocol (HTTP or TCP).`,
"clients",
c.Clients,
`
...`,
Number of clients.`,
)

fs.IntVar(
&c.Endpoints,
"endpoints",
c.Endpoints,
`
...`,
Number of endponits to connect to`,
)

fs.IntVar(
Expand All @@ -110,6 +133,8 @@ The size of each request. As the upstream echos the response body, the response
will have the same size.`,
)

c.Connect.RegisterFlags(fs)

c.Log.RegisterFlags(fs)
}

Expand Down

0 comments on commit 3cf9f5a

Please sign in to comment.