|
@@ -19,6 +19,7 @@ export class StackdriverQueryCtrl extends QueryCtrl {
|
|
|
id: string;
|
|
id: string;
|
|
|
name: string;
|
|
name: string;
|
|
|
};
|
|
};
|
|
|
|
|
+ unit: string;
|
|
|
metricType: string;
|
|
metricType: string;
|
|
|
service: string;
|
|
service: string;
|
|
|
refId: string;
|
|
refId: string;
|
|
@@ -47,6 +48,7 @@ export class StackdriverQueryCtrl extends QueryCtrl {
|
|
|
metricType: this.defaultDropdownValue,
|
|
metricType: this.defaultDropdownValue,
|
|
|
service: this.defaultServiceValue,
|
|
service: this.defaultServiceValue,
|
|
|
metric: '',
|
|
metric: '',
|
|
|
|
|
+ unit: '',
|
|
|
aggregation: {
|
|
aggregation: {
|
|
|
crossSeriesReducer: 'REDUCE_MEAN',
|
|
crossSeriesReducer: 'REDUCE_MEAN',
|
|
|
alignmentPeriod: 'auto',
|
|
alignmentPeriod: 'auto',
|
|
@@ -221,7 +223,8 @@ export class StackdriverQueryCtrl extends QueryCtrl {
|
|
|
|
|
|
|
|
setMetricType() {
|
|
setMetricType() {
|
|
|
this.target.metricType = this.metricType;
|
|
this.target.metricType = this.metricType;
|
|
|
- const { valueType, metricKind } = this.metricDescriptors.find(m => m.type === this.target.metricType);
|
|
|
|
|
|
|
+ const { valueType, metricKind, unit } = this.metricDescriptors.find(m => m.type === this.target.metricType);
|
|
|
|
|
+ this.target.unit = unit;
|
|
|
this.target.valueType = valueType;
|
|
this.target.valueType = valueType;
|
|
|
this.target.metricKind = metricKind;
|
|
this.target.metricKind = metricKind;
|
|
|
this.$scope.$broadcast('metricTypeChanged');
|
|
this.$scope.$broadcast('metricTypeChanged');
|