earthcubeprojects-chords / chords

EarthCube CHORDS application code
GNU General Public License v2.0
25 stars 13 forks source link

Downsampling of timeseries causes long delay in graphing display #537

Open mdye opened 5 years ago

mdye commented 5 years ago

The downsampling of timeseries data when fetched from influxdb causes a multiple second delay PER VARIABLE on the instrument "show" page for each instrument. For instruments with many variables, a high sampling rate or many accumulated measurements this renders the graph effectively unusable.

https://github.com/earthcubeprojects-chords/chords/blob/46d066369f1b9eea76107fbafb40368e201e31da/app/models/var.rb#L63

MisterMartin commented 4 years ago

Further clarification from @mdye:

The culprit seems to be the downsampling being performed when the timeseries points are fetched from influxdb.

See app/models/instrument.rb, https://github.com/earthcubeprojects-chords/chords/blob/46d066369f1b9eea76107fbafb40368e201e31da/app/models/instrument.rb#L52

and app/models/var.rb https://github.com/earthcubeprojects-chords/chords/blob/46d066369f1b9eea76107fbafb40368e201e31da/app/models/var.rb#L63 https://github.com/earthcubeprojects-chords/chords/blob/46d066369f1b9eea76107fbafb40368e201e31da/app/models/var.rb#L73