-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat/AN-4107 implement dimension selection (#66)
* implement dimension selection * fix linting errors * add metric support * add metric to query and check for null instead of undefined
- Loading branch information
Showing
6 changed files
with
656 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { SelectableValue } from '@grafana/data'; | ||
|
||
export enum METRICS { | ||
AVG_CONCURRENTVIEWERS = 'avg-concurrentviewers', | ||
MAX_CONCURRENTVIEWERS = 'max-concurrentviewers', | ||
AVG_DROPPED_FRAMES = 'avg-dropped-frames', | ||
} | ||
|
||
export type Metric = (typeof METRICS)[keyof typeof METRICS]; | ||
|
||
export const SELECTABLE_METRICS: Array<SelectableValue<Metric>> = [ | ||
{ value: METRICS.AVG_CONCURRENTVIEWERS, label: 'Avg Concurrent Viewers' }, | ||
{ value: METRICS.MAX_CONCURRENTVIEWERS, label: 'Max Concurrent Viewers' }, | ||
{ value: METRICS.AVG_DROPPED_FRAMES, label: 'Avg Dropped Frames' }, | ||
]; | ||
|
||
export const isMetric = (value: string): boolean => { | ||
return Object.values(METRICS).includes(value as Metric); | ||
}; |
Oops, something went wrong.