perfably

command module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: AGPL-3.0 Imports: 6 Imported by: 0

README

Perfably

A performance dashboard to compare metrics between software versions like the Jenkins Performance Plugin but in modern and CI server independent.

We used the Jenkins Performance Plugin but it's not customizable and looks old fashioned. So we created Perfably. Send performance metrics and meta data after every CI build via a simple HTTP API to perfably and get beautiful dashboards.

Here is an example for adding data to Perfably:

$ hyperfine --runs 1 'yarn build' --export-json result.json
$ http -a $AUTH --json POST "https://example.com/project/perfably/report/0.0.1" \
   "yarn_build_seconds:=$(jq '.results[].mean' result.json)"
$ http -a $AUTH --json POST "https://example.com/project/perfably/report/0.0.1/meta" \
   "yarn_version[value]=$(yarn --version)" \
   "commit[value]=$(git rev-parse HEAD)" \
   "commit[url]=https://github.com/FACT-Finder/perfably/commit/$(git rev-parse HEAD)"

And this is what the dashboard could look like:

example image

Install

Docker

The perfably/perfably container exposes the UI and HTTP API on port 8000. The users, metrics and meta data are stored inside /opt/perfably. No container is tagged with latest use unstable, if you don't want to explicitly define the tag (not recommended).

$ docker run -v "$PWD/data:/opt/perfably" -p 8000:8000 perfably/perfably:$VERSION
Binary

Download the latest release here, uncompress the archive and start perfably:

$ ./perfably --help
Source
  1. Install Go 1.18, Node >= 16 and a recent version of Yarn.
  2. Install oapi-codegen
    $ go install github.com/deepmap/oapi-codegen/cmd/[email protected]
    
  3. Build the UI:
    $ (cd ui && yarn install && yarn build)
    
  4. Run code generators (this downloads the swagger artifacts and generates the server methods from the openapi spec)
    $ go generate ./...
    
  5. Build with Go:
    $ go build
    

Config

In the config the projects and dashboards are defined. See example config with comments.

API

The API is documented via OpenAPI3, you can view the raw spec or swagger ui. The Swagger UI is also served on /docs/ on a running Perfably instance.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳