refactor(alerting): changes interval to string from int
This commit is contained in:
@@ -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(),
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user