Categorygithub.com/go-lo/agent
repositorypackage
0.3.1
Repository: https://github.com/go-lo/agent.git
Documentation: pkg.go.dev

# README

Go Report Card Build Status GoDoc

Agent

Agent provides an API which exposes a series of endpoints, documented below, which allow a user to upload and queue a loadtest and schedule to loadtest endpoints.

The best way to interact with this tool is with golo-cli.

Loadtest binaries are run as self contained executables- they're expected to expose an RPC server and print results to STDOUT in a specific line format. The easiest way of doing this is to implement the loadtest binary using github.com/go-lo/go-lo, but any binary which implements, at a minimum server.Run() and prints json fulfilling Output can be passed to an agent to be run.

Usage

The best way to use this application is via docker:

$ docker run -p8081:8081 -v $(pwd)/logs:/var/log/loadtest-agent goload/agent

This will volume mount stdout/err logs from binaries, as run, to ./logs - which can aid debugging.

This application accepts a series of command line flags:

$ docker run goload/agent --help
Usage of /agent:
  -collector string
        Collector endpoint (default "http://localhost:8082")
  -insecure
        Allow access to https endpoints with invalid certs/ certificate chains
  -logs string
        Dir to log to (default "/var/log/loadtest-agent")

API endpoints

Uploading and Queueing operations are done via an HTTP API. For sample implementation, see: github.com/go-lo/golo-client/client.go

POST /queue

This endpoint takes a file encoded in a multipart form- see here for an HTML representation of this.

StatusMessageDescription
400http: no such fileThe form field file was empty
400open /some/path no such file or directoryNot enough permissions to write uploads
400Binary $some_uuid existsSomehow, the same UUID was generated twice. Try again, raise a bug
200{"binary": "some-uuid"}Success! This binary ID will be needed when queueing the job

POST /queue

This endpoint takes a Job, in json form, and starts it

StatusMessageDescription
400invalid character '' looking for....The request json body was invalid
500any 500Could not read request body
400$some_uuid is an invalid binaryUUID not a valid binary on this instance- try re-up, or open bug
201{"queued": true}Success!