/rollercoaster

A visualization tool for performance trends

Primary LanguageGoApache License 2.0Apache-2.0

Roller Coaster

codebeat badge Go Report Card Travis CI Coverage Status Docker Image Docker Pulls

Roller Coaster is a standalone web application for visualization of performance trends.

It provides the following features:

  • Built-in chart plotter (based on Google Chart)
  • Embedded data storage (Bolt)
  • Simple RESTful API for data manipulation
  • No external dependencies

Demo

API

Currently, the application supports these endpoints:

Endpoint Method Payload Description
http://127.0.0.1:8080/api/v1/benchmarks GET N/A Gets a list of all "benchmark" objects
http://127.0.0.1:8080/api/v1/benchmarks POST benchmark Adds a new "benchmark" object to the data bucket
http://127.0.0.1:8080/api/v1/benchmarks DELETE id Deletes an existing "benchmark" object by id

The following status codes are used in API:

Methods Code Description
GET, DELETE 200 Success
POST 201 Benchmark added
DELETE, POST 400 Bad payload
DELETE, GET, POST 500 Internal error

"benchmark" object can be described using this JSON schema:

{
  "type": "object",
  "properties": {
    "group": {
      "type": "string"
    },
    "id": {
      "type": "integer"
    },
    "metric": {
      "type": "string"
    },
    "timestamp": {
      "type": "integer"
    },
    "value": {
      "type": "number"
    }
  },
  "required": [
    "group",
    "metric",
    "value"
  ]
}

"id" object can be described using this schema:

{
  "type": "object",
  "properties": {
    "id": {
      "type": "integer"
    }
  },
  "required": [
    "id""
  ]
}

Please notice that Unix timestamps and incremental IDs are automatically added to the documents upon successful POST request.

Examples:

> curl -XPOST -d '{"group":"ForestDB, Write-heavy workload","metric":"Read throughput, ops/sec","value":25000}' http://127.0.0.1:8080/api/v1/benchmarks
{
    "message": "ok"
}
> curl -XGET http://127.0.0.1:8080/api/v1/benchmarks
[
    {
        "group": "ForestDB, Write-heavy workload",
        "id": 1,
        "metric": "Read throughput, ops/sec",
        "timestamp": 1470851518959247351,
        "value": 25000
    }
]
> curl -XDELETE -d '{"id":1}' http://127.0.0.1:8080/api/v1/benchmarks
{
    "message": "ok"
}

Docker image

A small Docker image is available for this project:

> docker pull perflab/rollercoaster

> docker run -t -d -p 8080:8080 perflab/rollercoaster

Building from the source

First, install Go vendor tool:

> go get -u github.com/kardianos/govendor

Pull third-party packages into vendor folder:

> govendor sync

Build the project:

> go build

Now you should be able to run it from the command line:

> ./rollercoaster 

	.:: Please navigate to http://127.0.0.1:8080/ ::.