Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
f9f60c91
Unverified
Commit
f9f60c91
authored
Aug 13, 2020
by
Kyle Brandt
Committed by
GitHub
Aug 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AzureMonitor: map more units (#26990)
add BitsPerSecond and Seconds
parent
c63bbbae
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
pkg/tsdb/azuremonitor/azuremonitor-datasource.go
+12
-5
No files found.
pkg/tsdb/azuremonitor/azuremonitor-datasource.go
View file @
f9f60c91
...
...
@@ -390,23 +390,30 @@ func formatAzureMonitorLegendKey(alias string, resourceName string, metricName s
}
// Map values from:
// https://docs.microsoft.com/en-us/
azure/azure-monitor/platform/metrics-supported#microsoftanalysisservicesservers
// https://docs.microsoft.com/en-us/
rest/api/monitor/metrics/list#unit
// to
// https://github.com/grafana/grafana/blob/master/packages/grafana-data/src/valueFormats/categories.ts#L24
func
toGrafanaUnit
(
unit
string
)
string
{
switch
unit
{
case
"Percent"
:
return
"percent"
case
"Count"
:
return
"short"
// this is used for integers
case
"BitsPerSecond"
:
return
"bps"
case
"Bytes"
:
return
"decbytes"
// or ICE
case
"BytesPerSecond"
:
return
"Bps"
case
"Count"
:
return
"short"
// this is used for integers
case
"CountPerSecond"
:
return
"cps"
case
"Percent"
:
return
"percent"
case
"Milliseconds"
:
return
"ms"
case
"Seconds"
:
return
"s"
}
return
unit
// this will become a suffix in the display
// "ByteSeconds", "Cores", "MilliCores", and "NanoCores" all both:
// 1. Do not have a corresponding unit in Grafana's current list.
// 2. Do not have the unit listed in any of Azure Monitor's supported metrics anyways.
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment