refactor(alerting): changes interval to string from int

This commit is contained in:
bergquist
2016-04-20 16:57:03 +02:00
parent 262821e7e7
commit 96e88ee84d
4 changed files with 7 additions and 6 deletions
+2 -2
View File
@@ -12,7 +12,7 @@ type Alert struct {
QueryRefId string
WarnLevel string
CritLevel string
Interval int64
Interval string
Title string
Description string
QueryRange string
@@ -36,7 +36,7 @@ func (cmd *SaveDashboardCommand) GetAlertModels() *[]Alert {
QueryRefId: alerting.Get("query_ref").MustString(),
WarnLevel: alerting.Get("warn_level").MustString(),
CritLevel: alerting.Get("crit_level").MustString(),
Interval: alerting.Get("interval").MustInt64(),
Interval: alerting.Get("interval").MustString(),
Title: alerting.Get("title").MustString(),
Description: alerting.Get("description").MustString(),
QueryRange: alerting.Get("query_range").MustString(),
+2 -1
View File
@@ -74,7 +74,7 @@ func TestAlertModel(t *testing.T) {
"description": "Restart the webservers",
"query_range": "5m",
"aggregator": "avg",
"interval": 10
"interval": "10"
},
"targets": [
{
@@ -282,6 +282,7 @@ func TestAlertModel(t *testing.T) {
So(v.QueryRange, ShouldNotBeEmpty)
So(v.Title, ShouldNotBeEmpty)
So(v.Description, ShouldNotBeEmpty)
So(v.Interval, ShouldEqual, "10")
fmt.Println(v.Query)
}