Skip to content

Commit

Permalink
Merge branch 'main' into feat/increase-minute-interval-limit
Browse files Browse the repository at this point in the history
  • Loading branch information
MGJamJam authored Jul 25, 2024
2 parents 2a5a1ea + 18b3cc1 commit f4594ac
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

- different query start times with multiple queries due to mutating of grafana start time

### Added

- Default Percentile Value when percentile metric is selected

## 1.1.1

### Added
Expand Down
12 changes: 11 additions & 1 deletion src/components/QueryEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,17 @@ export function QueryEditor(props: Props) {
};

const handleAggregationChange = (item: SelectableValue) => {
props.onChange({ ...query, metric: item.value });
// set a default value when percentile is selected and delete percentileValue when percentile is deselected
// to not pollute the dashboard.json file
let percentile = undefined;
if (item.value === 'percentile' && percentileValue == null) {
setPercentileValue(95);
percentile = 95;
} else {
setPercentileValue(undefined);
}

props.onChange({ ...query, metric: item.value, percentileValue: percentile });
props.onRunQuery();
};

Expand Down

0 comments on commit f4594ac

Please sign in to comment.