Rename live option in queries (#19658)

pull/19637/head^2
David 6 years ago committed by GitHub
parent aa70abb35d
commit cf7ace6aad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      public/app/features/explore/state/actions.ts
  2. 2
      public/app/plugins/datasource/elasticsearch/specs/elastic_response.test.ts
  3. 2
      public/app/plugins/datasource/loki/datasource.ts
  4. 2
      public/app/plugins/datasource/loki/types.ts
  5. 4
      public/app/types/explore.ts

@ -33,7 +33,7 @@ import {
isDateTime,
dateTimeForTimeZone,
} from '@grafana/data';
import { ExploreId, ExploreUIState, ExploreMode } from 'app/types/explore';
import { ExploreId, ExploreUIState, ExploreMode, QueryOptions } from 'app/types/explore';
import {
updateDatasourceInstanceAction,
changeQueryAction,
@ -463,12 +463,12 @@ export function runQueries(exploreId: ExploreId): ThunkResult<void> {
stopQueryState(querySubscription);
const queryOptions = {
const queryOptions: QueryOptions = {
minInterval,
// This is used for logs streaming for buffer size, with undefined it falls back to datasource config if it
// supports that.
maxDataPoints: mode === ExploreMode.Logs ? undefined : containerWidth,
live,
liveStreaming: live,
showingGraph,
showingTable,
};

@ -797,7 +797,7 @@ describe('ElasticResponse', () => {
interval: '10s',
isLogsQuery: true,
key: 'Q-1561369883389-0.7611823271062786-0',
live: false,
liveStreaming: false,
maxDataPoints: 1620,
query: '',
timeField: '@timestamp',

@ -216,7 +216,7 @@ export class LokiDatasource extends DataSourceApi<LokiQuery, LokiOptions> {
const subQueries = options.targets
.filter(target => target.expr && !target.hide)
.map(target => {
if (target.live) {
if (target.liveStreaming) {
return this.runLiveQuery(options, target);
}
return this.runQuery(options, target);

@ -3,7 +3,7 @@ import { Labels } from '@grafana/data';
export interface LokiQuery extends DataQuery {
expr: string;
live?: boolean;
liveStreaming?: boolean;
query?: string;
regexp?: string;
}

@ -345,7 +345,9 @@ export interface QueryIntervals {
export interface QueryOptions {
minInterval: string;
maxDataPoints?: number;
live?: boolean;
liveStreaming?: boolean;
showingGraph?: boolean;
showingTable?: boolean;
}
export interface QueryTransaction {

Loading…
Cancel
Save