diff --git a/alert.go b/alert.go index a432e62..dc93f97 100644 --- a/alert.go +++ b/alert.go @@ -71,8 +71,9 @@ func (a alert) DailyGraphURL() string { return graphiteBase + "?target=" + a.Metric + "&target=threshold(" + fmt.Sprintf("%f", a.Threshold) + - ")&width=" + fmt.Sprintf("%d", graphWidth) + - "&height=" + fmt.Sprintf("%d", dailyGraphHeight) + + ")&width=" + fmt.Sprintf("%d", graphWidth * 2) + + "&height=" + fmt.Sprintf("%d", dailyGraphHeight * 2) + + "&fontSize=20" + "&bgcolor=" + dailyBgColor + "&fgcolor=" + fgColor + "&hideGrid=true&colorList=" + dailyColorlist + "&from=-24hours" @@ -82,8 +83,9 @@ func (a alert) WeeklyGraphURL() string { return graphiteBase + "?target=" + a.Metric + "&target=threshold(" + fmt.Sprintf("%f", a.Threshold) + - ")&width=" + fmt.Sprintf("%d", graphWidth) + - "&height=" + fmt.Sprintf("%d", weeklyGraphHeight) + + ")&width=" + fmt.Sprintf("%d", graphWidth * 2) + + "&height=" + fmt.Sprintf("%d", weeklyGraphHeight * 2) + + "&fontSize=20" + "&hideGrid=true&hideLegend=true&graphOnly=true&hideAxes=true&bgcolor=" + weeklyBgColor + "&fgcolor=" + fgColor + "&hideGrid=true&colorList=" + weeklyColorlist + "&from=-7days" diff --git a/alert_test.go b/alert_test.go index 2aae88c..0201bd8 100644 --- a/alert_test.go +++ b/alert_test.go @@ -39,14 +39,14 @@ func Test_URL(t *testing.T) { func Test_DailyGraphURL(t *testing.T) { a := newAlert("foo", "foo", "", 10, "above", DummyFetcher{}, "test@example.com", "") - if a.DailyGraphURL() != "?target=foo&target=threshold(10.000000)&width=800&height=150&bgcolor=FFFFFF&fgcolor=000000&hideGrid=true&colorList=%23999999,%23006699&from=-24hours" { + if a.DailyGraphURL() != "?target=foo&target=threshold(10.000000)&width=1600&height=300&fontSize=20&bgcolor=FFFFFF&fgcolor=000000&hideGrid=true&colorList=%23999999,%23006699&from=-24hours" { t.Error(fmt.Sprintf("wrong value: %s", a.DailyGraphURL())) } } func Test_WeeklyGraphURL(t *testing.T) { a := newAlert("foo", "foo", "", 10, "above", DummyFetcher{}, "test@example.com", "") - if a.WeeklyGraphURL() != "?target=foo&target=threshold(10.000000)&width=800&height=75&hideGrid=true&hideLegend=true&graphOnly=true&hideAxes=true&bgcolor=EEEEEE&fgcolor=000000&hideGrid=true&colorList=%23cccccc,%236699cc&from=-7days" { + if a.WeeklyGraphURL() != "?target=foo&target=threshold(10.000000)&width=1600&height=150&fontSize=20&hideGrid=true&hideLegend=true&graphOnly=true&hideAxes=true&bgcolor=EEEEEE&fgcolor=000000&hideGrid=true&colorList=%23cccccc,%236699cc&from=-7days" { t.Error(fmt.Sprintf("wrong value: %s", a.WeeklyGraphURL())) } }