Explore: Queries the datasource once per run query and uses DataStreamObserver (#17263)

* Refactor: Removes replaceUrl from actions

* Refactor: Moves saveState thunk to epic

* Refactor: Moves thunks to epics

* Wip: removes resulttype and queries once

* Refactor: LiveTailing uses observer in query

* Refactor: Creates epics folder for epics and move back actioncreators

* Tests: Adds tests for epics and reducer

* Fix: Checks for undefined as well

* Refactor: Cleans up previous live tailing implementation

* Chore: merge with master

* Fix: Fixes url issuses and prom graph in Panels

* Refactor: Removes supportsStreaming and adds sockets to DataSourcePluginMeta instead

* Refactor: Changes the way we create TimeSeries

* Refactor: Renames sockets to streaming

* Refactor: Changes the way Explore does incremental updates

* Refactor: Removes unused method

* Refactor: Adds back Loading indication
This commit is contained in:
Hugo Häggmark
2019-06-03 14:54:32 +02:00
committed by GitHub
parent 5761179ad9
commit fb39831df2
42 changed files with 2470 additions and 1353 deletions

View File

@@ -38,7 +38,7 @@ export class SetInterval extends PureComponent<Props> {
}
componentDidUpdate(prevProps: Props) {
if (_.isEqual(prevProps, this.props)) {
if ((isLive(prevProps.interval) && isLive(this.props.interval)) || _.isEqual(prevProps, this.props)) {
return;
}

View File

@@ -83,7 +83,7 @@ export interface DataSourcePluginMeta extends PluginMeta {
category?: string;
queryOptions?: PluginMetaQueryOptions;
sort?: number;
supportsStreaming?: boolean;
streaming?: boolean;
/**
* By default, hidden queries are not passed to the datasource
@@ -164,10 +164,6 @@ export abstract class DataSourceApi<
*/
abstract query(options: DataQueryRequest<TQuery>, observer?: DataStreamObserver): Promise<DataQueryResponse>;
convertToStreamTargets?(options: DataQueryRequest<TQuery>): Array<{ url: string; refId: string }>;
resultToSeriesData?(data: any, refId: string): SeriesData[];
/**
* Test & verify datasource settings & connection details
*/

View File

@@ -160,6 +160,7 @@ export const toLegacyResponseData = (series: SeriesData): TimeSeries | TableData
const type = guessFieldTypeFromSeries(series, 1);
if (type === FieldType.time) {
return {
alias: fields[0].name || series.name,
target: fields[0].name || series.name,
datapoints: rows,
unit: fields[0].unit,