getlantern/statshub — pull request #3 by oxtoacart (2014-05-08 18:47:59+00:00)
Title: Pull infrastructure changes for #1 and #2

This set of changes implements a new paradigm for combining historical values with streaming updates in a single chart.

- Each chart gets its own websocket
- Each chart specifies the dimension type, dimension name, stat type and stat name which it wants to query, with "*" meaning "all dimension names". For example fallback/*/counter/bytesGiven.
- When a websocket connects to statshub, statshub first runs a query against BigQuery to fetch historical data. Data is fetched for 1 year prior to today, with time slices provided at decreasing resolutions.
- Hourly intervals for last day
- Daily intervals for last week
- Weekly intervals for last month
- Monthly intervals for last year
- After the historical data has been sent to the client, statshub starts streaming live updates to the client at 30 second intervals (as before)

In this manner, the same line charts can be used to show historical trends and provide live monitoring at the same time.