A metric collection script for the StackExchange API.
View Some Realtime Stats
Here is a link for you to view some stats in real* time, with 1 year of history!
*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 sites 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:
- Total Votes
- Total Questions
- Total Answers
- Total Comments
- Total Accepted
- Accepted Percentage
- Total Users
- Total Badges
All per minute stats shown in Grafana are calculated by applying time function transformations to the total counts.
Multi Site Support
The configuration accepts a list of sites to poll. The hosted instance has the following sites available:
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.
Configuration & Usage
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 &
Update 9/13/18 Sorry, the domain name expired for some time there, but I never stopped collecting metrics! I have updated the active link, metrics can again be viewed with 1 year of history.