|root bf03022b76 Merge branch 'master' of https://github.com/MClarkDev/GrafOverflow.git||3 years ago|
|.gitignore||5 years ago|
|README.md||3 years ago|
|config.sample.js||5 years ago|
|grafana_dashboard.json||5 years ago|
|stackstats.js||4 years ago|
A metric collection script for the StackOverflow API.
Here is a link for you to view some stats in real* time.
*Stats are collected every 5 minutes, and smoothed to a 30 minute average ( on query ) to account for API caching.
Data is beautiful, so why not draw some beautiful graphs about the site that helps so many.
To query the API, I wrote up a node.js script that will run a collection on a 5 minute interval; this then parses the JSON response from the SE API into a format parsable by the metric engine, opens a socket, and sends it.
In the above screenshot, you can see the result of simply collecting and graphing the data returned by the /info API endpoint.
The list of statistics collected and graphed:
All per minute stats shown in Grafana are calculated by applying time function transformations to the total counts.
The script source can be found on GitHub.
Following in the path of StackExchange, this is published under the MIT License.
The application is built in node.js and outputs data in the carbon plaintext protocol.
This applications requires an instance of carbon-cache or equivalent metric storage engine to properly store stats; in addition, it requires a front end viewer - in this example, I am using graphite-web and Grafana.
To configure the application, simply copy
config.js and adjust your desired parameters.
To start the application, simply run the main file with node.
cd $APP_HOME node stackstats.js &>> log &