diff --git a/public/app/plugins/datasource/stackdriver/constants.ts b/public/app/plugins/datasource/stackdriver/constants.ts new file mode 100644 index 00000000000..3846bfc68a1 --- /dev/null +++ b/public/app/plugins/datasource/stackdriver/constants.ts @@ -0,0 +1,35 @@ +export const alignOptions = [ + { text: 'none', value: 'ALIGN_NONE' }, + { text: 'delta', value: 'ALIGN_DELTA' }, + { text: 'rate', value: 'ALIGN_RATE' }, + { text: 'interpolate', value: 'ALIGN_INTERPOLATE' }, + { text: 'next older', value: 'ALIGN_NEXT_OLDER' }, + { text: 'min', value: 'ALIGN_MIN' }, + { text: 'max', value: 'ALIGN_MAX' }, + { text: 'mean', value: 'ALIGN_MEAN' }, + { text: 'count', value: 'ALIGN_COUNT' }, + { text: 'sum', value: 'ALIGN_SUM' }, + { text: 'stddev', value: 'ALIGN_STDDEV' }, + { text: 'count true', value: 'ALIGN_COUNT_TRUE' }, + { text: 'count false', value: 'ALIGN_COUNT_FALSE' }, + { text: 'fraction true', value: 'ALIGN_FRACTION_TRUE' }, + { text: 'percentile 99', value: 'ALIGN_PERCENTILE_99' }, + { text: 'percentile 95', value: 'ALIGN_PERCENTILE_95' }, + { text: 'percentile 50', value: 'ALIGN_PERCENTILE_50' }, + { text: 'percentile 05', value: 'ALIGN_PERCENTILE_05' }, + { text: 'percent change', value: 'ALIGN_PERCENT_CHANGE' }, +]; + +export const aggOptions = [ + { text: 'none', value: 'REDUCE_NONE' }, + { text: 'mean', value: 'REDUCE_MEAN' }, + { text: 'min', value: 'REDUCE_MIN' }, + { text: 'max', value: 'REDUCE_MAX' }, + { text: 'sum', value: 'REDUCE_SUM' }, + { text: 'std. dev.', value: 'REDUCE_STDDEV' }, + { text: 'count', value: 'REDUCE_COUNT' }, + { text: '99th percentile', value: 'REDUCE_PERCENTILE_99' }, + { text: '95th percentile', value: 'REDUCE_PERCENTILE_95' }, + { text: '50th percentile', value: 'REDUCE_PERCENTILE_50' }, + { text: '5th percentile', value: 'REDUCE_PERCENTILE_05' }, +]; diff --git a/public/app/plugins/datasource/stackdriver/datasource.ts b/public/app/plugins/datasource/stackdriver/datasource.ts index bb1783c9a54..9c1706095bf 100644 --- a/public/app/plugins/datasource/stackdriver/datasource.ts +++ b/public/app/plugins/datasource/stackdriver/datasource.ts @@ -20,6 +20,7 @@ export default class StackdriverDatasource { if (!t.hasOwnProperty('aggregation')) { t.aggregation = { crossSeriesReducer: 'REDUCE_MEAN', + secondaryCrossSeriesReducer: 'REDUCE_NONE', groupBys: [], }; } @@ -28,6 +29,8 @@ export default class StackdriverDatasource { datasourceId: this.id, metricType: t.metricType, primaryAggregation: t.aggregation.crossSeriesReducer, + secondaryAggregation: t.aggregation.secondaryCrossSeriesReducer, + perSeriesAligner: t.aggregation.perSeriesAligner, groupBys: t.aggregation.groupBys, view: t.view || 'FULL', filters: t.filters, diff --git a/public/app/plugins/datasource/stackdriver/partials/query.editor.html b/public/app/plugins/datasource/stackdriver/partials/query.editor.html index fe48d09b595..23a7493c7b7 100755 --- a/public/app/plugins/datasource/stackdriver/partials/query.editor.html +++ b/public/app/plugins/datasource/stackdriver/partials/query.editor.html @@ -2,8 +2,8 @@