Skip to content
frozzarePublic

About

[WIP] Collect numerics stats via http

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

25 Commits

Folders and files

Repository files navigation

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

About

[WIP] Collect numerics stats via http

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

⌂ 换网址