Custom sampling rate for brewblox graph widget?

Is it possible to choose a custom downsampling rate in the graph widget? This would be especially nice for session view graphs.

I understand the downsampling is to keep long sessions with hundreds of thousands of data points from slowing down the ui, but it would be nice to be able to choose to zoom in and view more detail when the need arises.

Alternately, is there a way to export session data from the database (ie. in .csv format or something similar) so I could open it in another program (I have R in mind)?

Edit: for clarification: downsampling is done server-side, in timed intervals. We keep separate datasets with downsampled data, and downsampling is done using a cascading approach.

Zooming in is one of these things that’s technically possible, but not yet made user-friendly. The downsampled result set is selected automatically, based on how many points would be returned for your query. Zooming in can be done by narrowing the shown period in your graph.

As reference, you can select the “Combined Influx Points” metric. This keeps track of the downsample rate (X points downsampled to 1).

I can see about adding some settings for overriding the current sanity checks (disable downsampling, disable truncating result set at 2000 points), but the alternative is probably preferable anyway.

We use influxDB as the backing database for history data. The UI uses the history service as gateway / query builder, but nothing’s stopping you from directly accessing the database itself.

Some options available are:

  • Publishing the InfluxDB port (8086) in docker-compose.yml for access to the HTTP API.
  • Running the influx CLI client inside the docker container: docker-compose exec influx influx
    • This can be used to export to CSV
  • Connecting Grafana, a big and shiny suite of data visualization tools.

As bob said, data is always sampled at 5 seconds intervals, we just don’t load all of it in the chart.
I think the best solution for this is to try and implement ‘fetch more data on zoom’, but it is not straightforward to implement this with Plotly.js.

If someone’s looking for a small fun side project to have a go at it, let us know. Anyone that wants to contribute some dev work, ask to be added to our slack instance for a direct communication channel.

Thanks for the responses. I agree with Elco in that what I was imagining as the most ideal would be new queries every time you zoom in, but I was guessing that the current zoom features just came directly out of a library.

I’m probably not the right person to be messing around in javascript (I haven’t dabbled in it for 15-20 years). That said, I may look into it if I have some time later this summer. If I’m going to dabble in any javascript, plotly would be a reasonable place to start as it is somewhat relevant to my field (I’m an economist and interactive dashboards are in fashion).