mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
stackdriver: distinct grafana auto from stackdriver auto in alignment period
This commit is contained in:
@@ -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"
|
||||
}
|
||||
|
@@ -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"},
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user