grafana/public/app/features/explore/utils
David 57abf39f25
Logs: Use result range instead of timepicker range for log histogram (#25027)
* Logs: Use result range instead of timepicker range for log histogram

If a logs datasource does not send histogram data for the requested
time range, the logs model computes a timeseries based on the log row
counts, bucketed by an automcatically calculated time interval. Even
when this histogram time series did not span the whole requested time
range it was still rendered in the graph across the whole range, leaving
an empty area at its start. Users find this confusing and are lead to
believe their log data is missing.

This change fixes this by anchoring the start of the timeseries on the
first log row's timestamp from the result, and adds this smaller range
as `visibleRange` to the logs model and passes it through to the logs
component that optionally takes it into account to not render the empty
area.
The interval (bucket size) is also adjusted to account for a potentially
finer resolution on the shorter visible time interval.
The bucketsize multiplier was also changed from 10 to 20 to account for
the space between the chart's bars.

* Aligned visible range with buckets

* Extract bucket size calculation and add test
2020-05-29 15:39:13 +02:00
..
links.test.ts Migration: Dashboard links (#23553) 2020-05-05 09:49:34 +02:00
links.ts Loki: Allow multiple derived fields with the same name (#24437) 2020-05-12 17:20:00 +02:00
LogsCrossFadeTransition.tsx Livetailing: set table withd to 100% (#21213) 2019-12-20 11:21:04 +01:00
ResultProcessor.test.ts Explore: fixes log entries sorting - changes milliseconds to nanoseconds (#24303) 2020-05-07 13:53:24 +02:00
ResultProcessor.ts Logs: Use result range instead of timepicker range for log histogram (#25027) 2020-05-29 15:39:13 +02:00
set.test.ts Fix set utilities for explore section 2018-11-21 21:42:53 +08:00
set.ts Fix set utilities for explore section 2018-11-21 21:42:53 +08:00