gmeter

command module
v0.1.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

README

gmeter
GoDoc

Make RESTful HTTP More Easy

What is gmeter

gmeter customizes HTTP RESTful clients and HTTP RESTful servers and runs them by configuration. With variable and command system supports, json acts as a script language to process HTTP request and response.

Features

  1. test case configure with json;
  2. gmeter environment variables access and fantastic embedded command system with pipeline support;
  3. test control over specified count or iterable command
  4. concurrency
  5. test pipeline
  6. customized response checking and reporting
  7. proxy support
  8. performance monitoring, QPS limiting(under development)
  9. json compare based on template(under development)
  10. arithmatic and logical expressions support.

Install

go get github.com/forrestjgq/gmeter

It will be installed into $GOBIN(if it's empty, get from go env $GOBIN). It requires you've got a GO environment.

Or you may directly install to /usr/local/bin:

curl -sf https://gobinaries.com/forrestjgq/gmeter | sh

root permission may be required to install.

Usage

gmeter [options] <config>[, <config>, ...]

<config> is a file path, it could be - A json file path(end with .json), a sample can be get here, see Configuration, or - A list file, each line contains a file path ends with .json will be treated as a gmeter configuration and will be called. If it is an relative path, it's related to <config>'s directory. In a line, # is considered to be start of comment, any thing after (and include) # will be ignored. Empty line is allowed. - A directory, any .json file in this directory and sub-directories of this directory will be treated as a test configuration and will be called.

Optional arguments includes:

  • -t, -template <config>: load an HTTP client template configuration. <template-config> is a configure json file used as a base configuration. If this argument is present, the Hosts/Messages/Tests/Env/Options will be copied to all <config> if target configuration does not define those items identified by the key of map. An example could be find in template and configuration, and the command line would be gmeter -template example/base.json example/sep.json.
  • -httpsrv <http-server-config>: start an HTTP server. <http-server-config> is configure json file path for creating http server, a sample can be get here, see HTTP Server Configuration for more information.
  • -e="k1=v1 k2=v2 ...": predefined global variables. Each variable is defined in key=value form, and multiple key value pairs are seperated by spaces.
  • -call <commandline>: command line called before any config is executed and after any server is started.
  • -f <final>: final config called even running fails.
  • -gm <port>: set GoMark HTTP port, default 7777.
  • -fs <path:port>: enable a file server for local file system <path> using HTTP server on port <port>

Documents

TODOs

  1. gomark support
  2. better logging

Thanks

Jetbrains

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
cfg
Package config defines a configuration for gmeter to use to start a series HTTP restful test.
Package config defines a configuration for gmeter to use to start a series HTTP restful test.
internal
argv
Package argv parse command line string into arguments array using the bash syntax.
Package argv parse command line string into arguments array using the bash syntax.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL