@@ -11,8 +11,9 @@ const (
1111
1212 defaultBypassRegistry = 1
1313 defaultConnections = 256
14+ defaultPoolSize = 256
1415 defaultDuration = 15
15- defaultTimeout = 8
16+ defaultTimeout = 15
1617 defaultTransport = "grpc"
1718 defaultPackageSize = 1000
1819 defaultContentType = "application/x-protobuf"
@@ -29,63 +30,75 @@ func flags() []*cli.Flag {
2930 flags = append (flags , cli .NewFlag (
3031 "bypass_registry" ,
3132 defaultBypassRegistry ,
32- cli .FlagConfigPaths (cli.FlagConfigPath {Path : []string {configSection , "bypassRegistry" }}),
33+ cli .FlagConfigPaths (cli.FlagConfigPath {Path : []string {configSection , "bypassRegistry" }, IsGlobal : true }),
3334 cli .FlagUsage ("Bypasses the registry by caching it, set to 0 to disable" ),
3435 cli .FlagEnvVars ("BYPASS_REGISTRY" ),
3536 ))
3637
38+ flags = append (flags , cli .NewFlag (
39+ "pool_size" ,
40+ defaultPoolSize ,
41+ cli .FlagConfigPaths (
42+ cli.FlagConfigPath {Path : []string {"client" , "poolSize" }},
43+ ),
44+ cli .FlagUsage ("Number of connections to keep open" ),
45+ cli .FlagEnvVars ("POOL_SIZE" ),
46+ ))
47+
3748 flags = append (flags , cli .NewFlag (
3849 "connections" ,
3950 defaultConnections ,
40- cli .FlagConfigPaths (cli.FlagConfigPath {Path : []string {configSection , "connections" }}),
51+ cli .FlagConfigPaths (
52+ cli.FlagConfigPath {Path : []string {configSection , "connections" }, IsGlobal : true },
53+ ),
4154 cli .FlagUsage ("Connections to keep open" ),
4255 cli .FlagEnvVars ("CONNECTIONS" ),
4356 ))
4457
4558 flags = append (flags , cli .NewFlag (
4659 "duration" ,
4760 defaultDuration ,
48- cli .FlagConfigPaths (cli.FlagConfigPath {Path : []string {configSection , "duration" }}),
61+ cli .FlagConfigPaths (cli.FlagConfigPath {Path : []string {configSection , "duration" }, IsGlobal : true }),
4962 cli .FlagUsage ("Duration in seconds" ),
5063 cli .FlagEnvVars ("DURATION" ),
5164 ))
5265
5366 flags = append (flags , cli .NewFlag (
5467 "timeout" ,
5568 defaultTimeout ,
56- cli .FlagConfigPaths (cli.FlagConfigPath {Path : []string {configSection , "timeout" }}),
69+ cli .FlagConfigPaths (cli.FlagConfigPath {Path : []string {configSection , "timeout" }, IsGlobal : true }),
5770 cli .FlagUsage ("Timeout in seconds" ),
5871 cli .FlagEnvVars ("TIMEOUT" ),
5972 ))
6073
6174 flags = append (flags , cli .NewFlag (
6275 "threads" ,
6376 defaultThreads ,
64- cli .FlagConfigPaths (cli.FlagConfigPath {Path : []string {configSection , "threads" }}),
77+ cli .FlagConfigPaths (cli.FlagConfigPath {Path : []string {configSection , "threads" }, IsGlobal : true }),
6578 cli .FlagUsage ("Number of threads to use = runtime.GOMAXPROCS()" ),
6679 cli .FlagEnvVars ("THREADS" ),
6780 ))
6881
6982 flags = append (flags , cli .NewFlag (
7083 "transport" ,
7184 defaultTransport ,
72- cli .FlagConfigPaths (cli.FlagConfigPath {Path : []string {configSection , "transport" }}),
85+ cli .FlagConfigPaths (cli.FlagConfigPath {Path : []string {configSection , "transport" }, IsGlobal : true }),
7386 cli .FlagUsage ("Transport to use (grpc, drpc, http, uvm.)" ),
7487 cli .FlagEnvVars ("TRANSPORT" ),
7588 ))
7689
7790 flags = append (flags , cli .NewFlag (
7891 "package_size" ,
7992 defaultPackageSize ,
80- cli .FlagConfigPaths (cli.FlagConfigPath {Path : []string {configSection , "packageSize" }}),
93+ cli .FlagConfigPaths (cli.FlagConfigPath {Path : []string {configSection , "packageSize" }, IsGlobal : true }),
8194 cli .FlagUsage ("Per request package size" ),
8295 cli .FlagEnvVars ("PACKAGE_SIZE" ),
8396 ))
8497
8598 flags = append (flags , cli .NewFlag (
8699 "content_type" ,
87100 defaultContentType ,
88- cli .FlagConfigPaths (cli.FlagConfigPath {Path : []string {configSection , "contentType" }}),
101+ cli .FlagConfigPaths (cli.FlagConfigPath {Path : []string {configSection , "contentType" }, IsGlobal : true }),
89102 cli .FlagUsage ("Content-Type (application/x-protobuf, application/x-protobuf+json)" ),
90103 cli .FlagEnvVars ("CONTENT_TYPE" ),
91104 ))
@@ -95,6 +108,7 @@ func flags() []*cli.Flag {
95108
96109type clientConfig struct {
97110 BypassRegistry int `json:"bypassRegistry" yaml:"bypassRegistry"`
111+ PoolSize int `json:"poolSize" yaml:"poolSize"`
98112 Connections int `json:"connections" yaml:"connections"`
99113 Duration int `json:"duration" yaml:"duration"`
100114 Timeout int `json:"timeout" yaml:"timeout"`
0 commit comments