Giter VIP home page Giter VIP logo

counter's Introduction

Counter

Tracks sum, count, and average for any arbitrary metrics that you send to it.

Installation

Download the binary for your platform from the bin directory to the location where you want it to store data, then run it as an unpriviledged user. It will run on port 8080 by default.

API endpoints

GET /metric

List metrics that are currently being tracked

GET /metric/:name

Get a JSON representation of all samples currently being tracked for this metric

GET /metric/:name/:operation.png

Get a PNG representation of this metric, where operation is "sum", "count", or "avg"

Image

POST /metric

Send metrics to be tracked. Any unrecognized metrics will be created automatically. The API format is as follows:

{
    "metric.name": {
        "count": 100,
        "value": 86753.09
    }
}

Multiple metrics can be sent in a single request, and you can aggregate upstream by including a count in your request. Count is optional, and will default to 1.

Purging data

If you no longer wish to track a metric, stop the server, delete its datafile in the data directory, then restart the server.

Installing systemd service so it starts on boot

Assuming you install counter to /opt/counter on Ubuntu, you can download the counter.example.service and run the following:

sudo mv counter.example.service /lib/systemd/system/counter.service
sudo systemctl start counter

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.