Work in progress!
Collect numerics stats via http. It's not amed to be complex or advanced.
go get -u github.com/frozzare/statscoll
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=trueThen 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:
startto filter stat values that starts with timestamp valueendto filter stat values that ends with timestamp valuelastto filter stat values that are within the last days value, e.glast=30to show last 30 days.projectto 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
}MIT © Fredrik Forsmo