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
ac345312
Commit
ac345312
authored
Feb 11, 2019
by
Daniel Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
azuremonitor: don't use make for maps and array
parent
0b74860f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
pkg/tsdb/azuremonitor/azuremonitor-datasource.go
+3
-3
pkg/tsdb/azuremonitor/azuremonitor.go
+1
-1
pkg/tsdb/azuremonitor/time-grain.go
+1
-1
No files found.
pkg/tsdb/azuremonitor/azuremonitor-datasource.go
View file @
ac345312
...
...
@@ -41,7 +41,7 @@ var (
// 3. parses the responses for each query into the timeseries format
func
(
e
*
AzureMonitorDatasource
)
executeTimeSeriesQuery
(
ctx
context
.
Context
,
originalQueries
[]
*
tsdb
.
Query
,
timeRange
*
tsdb
.
TimeRange
)
(
*
tsdb
.
Response
,
error
)
{
result
:=
&
tsdb
.
Response
{
Results
:
ma
ke
(
map
[
string
]
*
tsdb
.
QueryResult
)
,
Results
:
ma
p
[
string
]
*
tsdb
.
QueryResult
{}
,
}
queries
,
err
:=
e
.
buildQueries
(
originalQueries
,
timeRange
)
...
...
@@ -84,7 +84,7 @@ func (e *AzureMonitorDatasource) buildQueries(queries []*tsdb.Query, timeRange *
azureMonitorTarget
:=
query
.
Model
.
Get
(
"azureMonitor"
)
.
MustMap
()
azlog
.
Debug
(
"AzureMonitor"
,
"target"
,
azureMonitorTarget
)
urlComponents
:=
ma
ke
(
map
[
string
]
string
)
urlComponents
:=
ma
p
[
string
]
string
{}
urlComponents
[
"resourceGroup"
]
=
fmt
.
Sprintf
(
"%v"
,
azureMonitorTarget
[
"resourceGroup"
])
urlComponents
[
"metricDefinition"
]
=
fmt
.
Sprintf
(
"%v"
,
azureMonitorTarget
[
"metricDefinition"
])
urlComponents
[
"resourceName"
]
=
fmt
.
Sprintf
(
"%v"
,
azureMonitorTarget
[
"resourceName"
])
...
...
@@ -247,7 +247,7 @@ func (e *AzureMonitorDatasource) parseResponse(queryRes *tsdb.QueryResult, data
}
for
_
,
series
:=
range
data
.
Value
[
0
]
.
Timeseries
{
points
:=
make
([]
tsdb
.
TimePoint
,
0
)
points
:=
[]
tsdb
.
TimePoint
{}
metadataName
:=
""
metadataValue
:=
""
...
...
pkg/tsdb/azuremonitor/azuremonitor.go
View file @
ac345312
...
...
@@ -46,7 +46,7 @@ func (e *AzureMonitorExecutor) Query(ctx context.Context, dsInfo *models.DataSou
var
result
*
tsdb
.
Response
var
err
error
azureMonitorQueries
:=
make
([]
*
tsdb
.
Query
,
0
)
var
azureMonitorQueries
[]
*
tsdb
.
Query
for
_
,
query
:=
range
tsdbQuery
.
Queries
{
queryType
:=
query
.
Model
.
Get
(
"queryType"
)
.
MustString
(
""
)
...
...
pkg/tsdb/azuremonitor/time-grain.go
View file @
ac345312
...
...
@@ -34,7 +34,7 @@ func (tg *TimeGrain) createISO8601DurationFromIntervalMS(interval int64) (string
unit
:=
formatted
[
len
(
formatted
)
-
1
:
]
if
unit
==
"s"
&&
timeValue
<
60
{
// mi
mu
mum interval is 1m for Azure Monitor
// mi
ni
mum interval is 1m for Azure Monitor
return
"PT1M"
,
nil
}
...
...
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