statscoll

command module
v0.0.0-...-132e2ad Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2018 License: MIT Imports: 12 Imported by: 0

README

statscoll Build Status Go Report Card

Work in progress!

Collect numerics stats via http. It's not amed to be complex or advanced.

Installation

go get -u github.com/frozzare/statscoll

Usage

Create a config file config.yml

The dsn value is the data source name used to connect to the mysql database. Read more about dsn.

This is the default values.

port: 9300
dsn: root@/statscoll?charset=utf8&parseTime=true

Then run it:

statscoll [-c config.yml]

Then you can add stats via http:

POST /collect
{
    "metric": "metric-name",
    "value": 10.0
}

Additional properties:

  • custom timestamp
  • project name project

Then you can list stats value:

GET /stats/metric-name
[
    {
        "metric": "metric-name",
        "value": 10.0
    }
]

Possible query strings are:

  • start to filter stat values that starts with timestamp value
  • end to filter stat values that ends with timestamp value
  • last to filter stat values that are within the last days value, e.g last=30 to show last 30 days.
  • project to filter projects with same metric names as other projects.

Get total of value with the same query strings as for stats endpoint:

GET /total/metric-name
{
    "total": 10.0
}

License

MIT © Fredrik Forsmo

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