Recording Stats at VHS
VHS has an InfluxDB/Grafana instance to record and graph datapoints in the cloud.
InfluxDB
InfluxDB is a time-series database. What that means, is that it stores data with respect to time.
Consider a MySQL database. Except instead of sending a new value and overwriting the previous data, InfluxDB keeps track of both, along with the time they were sent (unless you specify a different time).
You can also specify “retention policies” that phase out old datapoints, basic arithmetic and soon, some native analytics.
Some use-cases are current temperature, price of Bitcoin, or common “open” times for isvhsopen.com
A Dataset Example
<WRAP center round box 60%>
{
"results": [
{
"series": [
{
"name": "cpu_load_short",
"columns": [
"time",
"value"
],
"values": [
[
"2015-01-29T21:55:43.702900257Z",
0.55
],
[
"2015-01-29T21:55:43.702900257Z",
23422
],
[
"2015-06-11T20:46:02Z",
0.64
]
]
}
]
}
]
}
</WRAP>
A sample exploration
Login to the InfluxDB interface (linked below)
Select the “api” database in top right
<WRAP center round box 60%> SHOW SERIES
SHOW MEASUREMENTS
SHOW TAG KEYS FROM “api”
SHOW TAG VALUES FROM “api” WITH KEY = “name” </WRAP>
Grafana
Grafana takes those datapoints and makes pretty graphs out of them.
Links
- InfluxDB: http://stats.vanhack.ca:8083/ - Use “admin” and standard VHS credentials
- Grafana: http://stats.vanhack.ca:3000/ - Create your own account!
- Get your head around it: https://docs.influxdata.com/influxdb/v0.9/concepts/key_concepts/
- Get your hands dirty: https://docs.influxdata.com/influxdb/v0.9/guides/querying_data/
- Operation scripts for installation details: https://github.com/vhs/vhs-ops-scripts