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
af9033f3
Commit
af9033f3
authored
Sep 26, 2018
by
Erik Sundell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stackdriver: distinct grafana auto from stackdriver auto in alignment period
parent
13c68e6e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
pkg/tsdb/stackdriver/stackdriver.go
+1
-1
pkg/tsdb/stackdriver/stackdriver_test.go
+3
-3
public/app/plugins/datasource/stackdriver/constants.ts
+2
-1
No files found.
pkg/tsdb/stackdriver/stackdriver.go
View file @
af9033f3
...
...
@@ -184,7 +184,7 @@ func setAggParams(params *url.Values, query *tsdb.Query) {
perSeriesAligner
=
"ALIGN_MEAN"
}
if
alignmentPeriod
==
"auto"
||
alignmentPeriod
==
""
{
if
alignmentPeriod
==
"
grafana-
auto"
||
alignmentPeriod
==
""
{
alignmentPeriodValue
:=
int
(
math
.
Max
(
float64
(
query
.
IntervalMs
),
60.0
))
alignmentPeriod
=
"+"
+
strconv
.
Itoa
(
alignmentPeriodValue
)
+
"s"
}
...
...
pkg/tsdb/stackdriver/stackdriver_test.go
View file @
af9033f3
...
...
@@ -67,12 +67,12 @@ func TestStackdriver(t *testing.T) {
So
(
queries
[
0
]
.
Params
[
"filter"
][
0
],
ShouldEqual
,
`metric.type="a/metric/type" key="value" key2="value2"`
)
})
Convey
(
"and alignmentPeriod is set to auto"
,
func
()
{
Convey
(
"and alignmentPeriod is set to
grafana-
auto"
,
func
()
{
Convey
(
"and IntervalMs is larger than 60"
,
func
()
{
tsdbQuery
.
Queries
[
0
]
.
IntervalMs
=
1000
tsdbQuery
.
Queries
[
0
]
.
Model
=
simplejson
.
NewFromAny
(
map
[
string
]
interface
{}{
"target"
:
"target"
,
"alignmentPeriod"
:
"auto"
,
"alignmentPeriod"
:
"
grafana-
auto"
,
"filters"
:
[]
interface
{}{
"key"
,
"="
,
"value"
,
"AND"
,
"key2"
,
"="
,
"value2"
},
})
...
...
@@ -84,7 +84,7 @@ func TestStackdriver(t *testing.T) {
tsdbQuery
.
Queries
[
0
]
.
IntervalMs
=
30
tsdbQuery
.
Queries
[
0
]
.
Model
=
simplejson
.
NewFromAny
(
map
[
string
]
interface
{}{
"target"
:
"target"
,
"alignmentPeriod"
:
"auto"
,
"alignmentPeriod"
:
"
grafana-
auto"
,
"filters"
:
[]
interface
{}{
"key"
,
"="
,
"value"
,
"AND"
,
"key2"
,
"="
,
"value2"
},
})
...
...
public/app/plugins/datasource/stackdriver/constants.ts
View file @
af9033f3
...
...
@@ -243,7 +243,8 @@ export const aggOptions = [
];
export
const
alignmentPeriods
=
[
{
text
:
'auto'
,
value
:
'auto'
},
{
text
:
'grafana auto'
,
value
:
'grafana-auto'
},
{
text
:
'stackdriver auto'
,
value
:
'stackdriver-auto'
},
{
text
:
'1m'
,
value
:
'+60s'
},
{
text
:
'5m'
,
value
:
'+300s'
},
{
text
:
'30m'
,
value
:
'+1800s'
},
...
...
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