Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use more descriptive flags for ghz CLI ? #75

Closed
bojand opened this issue Mar 14, 2019 · 3 comments
Closed

Use more descriptive flags for ghz CLI ? #75

bojand opened this issue Mar 14, 2019 · 3 comments
Assignees
Labels
CLI Issues for ghz CLI enhancement New feature or request

Comments

@bojand
Copy link
Owner

bojand commented Mar 14, 2019

While the current flags are compact and succinct, it may be worth while to change (some) flags to longer more descriptive format to improve UX. Potentially we could keep the short format as optional shorter and quicker alternatives.

For example some ideas for potential changes:

-c -> -concurrency
-n -> -requests? keep the same?
-q -> -qps (or -rate?)
-t -> -timeout
-z -> -duration
-x -> -max-duration
-d -> -data
-D -> -data-path
-b -> -binary-data
-B -> -binary-data-path
-m -> -metadata
-M -> -metadata-path
-si -> -stream-interval
-rmd -> -reflect-metadata
-o -> -out
-O -> -format
-i -> -import-paths
-T -> -dial-timeout
-L -> -keepalive
-v -> -version
-h -> -help

It seems most benchmarking tools opt for short options. But from research a handful offer descriptive flags as well. Some ideas or inspirations: autocannon and vegeta.

This may likely be a breaking change for the config file format.

To support both short and long format we may switch from standard flag module to something more robust, like kingpin perhaps.

@peter-edge Feel free to share any thoughts.

@bojand bojand added enhancement New feature or request CLI Issues for ghz CLI labels Mar 14, 2019
@bojand bojand self-assigned this Mar 14, 2019
@bufdev
Copy link
Contributor

bufdev commented Mar 14, 2019

My two cents: I'd appreciate it if it matched Prototool as much as possible:

Flags:
      --address string           The GRPC endpoint to connect to. This is required.
      --cacert string            File containing trusted root certificates for verifying the server. Can also be a file containing the public certificate of the server itself. If set, --tls is required.
      --cache-path string        The path to use for the cache, otherwise uses the default behavior. The user is expected to clean and manage this cache path. See prototool help cache update for more details.
      --call-timeout string      The maximum time to for all calls to be completed. (default "60s")
      --cert string              File containing client certificate (public key) in pem encoded format to present to the server for mutual TLS authentication. If set, --tls and --key is required.
      --connect-timeout string   The maximum time to wait for the connection to be established. (default "10s")
      --data string              The GRPC request data in JSON format. Either this or --stdin is required.
      --details                  Output headers, trailers, and status as well as the responses.
      --error-format string      The colon-separated fields to print out on error. Valid values are "filename:line:column:id:message". (default "filename:line:column:message")
  -H, --header strings           Additional request headers in 'name:value' format.
      --insecure                 Disable host certificate validation for TLS connections. If set, --tls is required and --cert, --key, --cacert and --server-name must not be set.
      --keepalive-time string    The maximum idle time after which a keepalive probe is sent.
      --key string               File containing client key (private key) in pem encoded format to use for mutual TLS authentication. If set, --tls and --cert is required.
      --method string            The GRPC method to call in the form package.Service/Method. This is required.
      --stdin                    Read the GRPC request data from stdin in JSON format. Either this or --data is required.
      --tls                      Enable SSL/TLS connection to remote host.

@bufdev
Copy link
Contributor

bufdev commented Mar 14, 2019

Also grpcurl:

Available flags:
  -H value
    	Additional headers in 'name: value' format. May specify more than one
    	via multiple flags. These headers will also be included in reflection
    	requests requests to a server.
  -authority string
    	Value of :authority pseudo-header to be use with underlying HTTP/2
    	requests. It defaults to the given address.
  -cacert string
    	File containing trusted root certificates for verifying the server.
    	Ignored if -insecure is specified.
  -cert string
    	File containing client certificate (public key), to present to the
    	server. Not valid with -plaintext option. Must also provide -key option.
  -connect-timeout float
    	The maximum time, in seconds, to wait for connection to be established.
    	Defaults to 10 seconds.
  -d string
    	Data for request contents. If the value is '@' then the request contents
    	are read from stdin. For calls that accept a stream of requests, the
    	contents should include all such request messages concatenated together
    	(possibly delimited; see -format).
  -emit-defaults
    	Emit default values for JSON-encoded responses.
  -format string
    	The format of request data. The allowed values are 'json' or 'text'. For
    	'json', the input data must be in JSON format. Multiple request values
    	may be concatenated (messages with a JSON representation other than
    	object must be separated by whitespace, such as a newline). For 'text',
    	the input data must be in the protobuf text format, in which case
    	multiple request values must be separated by the "record separator"
    	ASCII character: 0x1E. The stream should not end in a record separator.
    	If it does, it will be interpreted as a final, blank message after the
    	separator. (default "json")
  -help
    	Print usage instructions and exit.
  -import-path value
    	The path to a directory from which proto sources can be imported, for
    	use with -proto flags. Multiple import paths can be configured by
    	specifying multiple -import-path flags. Paths will be searched in the
    	order given. If no import paths are given, all files (including all
    	imports) must be provided as -proto flags, and grpcurl will attempt to
    	resolve all import statements from the set of file names given.
  -insecure
    	Skip server certificate and domain verification. (NOT SECURE!) Not
    	valid with -plaintext option.
  -keepalive-time float
    	If present, the maximum idle time in seconds, after which a keepalive
    	probe is sent. If the connection remains idle and no keepalive response
    	is received for this same period then the connection is closed and the
    	operation fails.
  -key string
    	File containing client private key, to present to the server. Not valid
    	with -plaintext option. Must also provide -cert option.
  -max-msg-sz int
    	The maximum encoded size of a response message, in bytes, that grpcurl
    	will accept. If not specified, defaults to 4,194,304 (4 megabytes).
  -max-time float
    	The maximum total time the operation can take, in seconds. This is
    	useful for preventing batch jobs that use grpcurl from hanging due to
    	slow or bad network links or due to incorrect stream method usage.
  -msg-template
    	When describing messages, show a template of input data.
  -plaintext
    	Use plain-text HTTP/2 when connecting to server (no TLS).
  -proto value
    	The name of a proto source file. Source files given will be used to
    	determine the RPC schema instead of querying for it from the remote
    	server via the gRPC reflection API. When set: the 'list' action lists
    	the services found in the given files and their imports (vs. those
    	exposed by the remote server), and the 'describe' action describes
    	symbols found in the given files. May specify more than one via multiple
    	-proto flags. Imports will be resolved using the given -import-path
    	flags. Multiple proto files can be specified by specifying multiple
    	-proto flags. It is an error to use both -protoset and -proto flags.
  -protoset value
    	The name of a file containing an encoded FileDescriptorSet. This file's
    	contents will be used to determine the RPC schema instead of querying
    	for it from the remote server via the gRPC reflection API. When set: the
    	'list' action lists the services found in the given descriptors (vs.
    	those exposed by the remote server), and the 'describe' action describes
    	symbols found in the given descriptors. May specify more than one via
    	multiple -protoset flags. It is an error to use both -protoset and
    	-proto flags.
  -reflect-header value
    	Additional reflection headers in 'name: value' format. May specify more
    	than one via multiple flags. These headers will *only* be used during
    	reflection requests and will be excluded when invoking the requested RPC
    	method.
  -rpc-header value
    	Additional RPC headers in 'name: value' format. May specify more than
    	one via multiple flags. These headers will *only* be used when invoking
    	the requested RPC method. They are excluded from reflection requests.
  -servername string
    	Override server name when validating TLS certificate.
  -unix
    	Indicates that the server address is the path to a Unix domain socket.
  -v	Enable verbose output.
  -version
    	Print version.

@bojand bojand mentioned this issue Apr 1, 2019
@bojand
Copy link
Owner Author

bojand commented Apr 6, 2019

Released in 0.33.0. Open to further feedback and improvements. Please note that this introduced breaking changes with regards to the config file.

@bojand bojand closed this as completed Apr 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI Issues for ghz CLI enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants