mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
This commit is contained in:
@@ -73,6 +73,7 @@ var unitMultiplier = map[string]int{
|
|||||||
"s": 1,
|
"s": 1,
|
||||||
"m": 60,
|
"m": 60,
|
||||||
"h": 3600,
|
"h": 3600,
|
||||||
|
"d": 86400,
|
||||||
}
|
}
|
||||||
|
|
||||||
func getTimeDurationStringToSeconds(str string) (int64, error) {
|
func getTimeDurationStringToSeconds(str string) (int64, error) {
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ func TestAlertRuleFrequencyParsing(t *testing.T) {
|
|||||||
{input: "10s", result: 10},
|
{input: "10s", result: 10},
|
||||||
{input: "10m", result: 600},
|
{input: "10m", result: 600},
|
||||||
{input: "1h", result: 3600},
|
{input: "1h", result: 3600},
|
||||||
|
{input: "1d", result: 86400},
|
||||||
{input: "1o", result: 1},
|
{input: "1o", result: 1},
|
||||||
{input: "0s", err: ErrFrequencyCannotBeZeroOrLess},
|
{input: "0s", err: ErrFrequencyCannotBeZeroOrLess},
|
||||||
{input: "0m", err: ErrFrequencyCannotBeZeroOrLess},
|
{input: "0m", err: ErrFrequencyCannotBeZeroOrLess},
|
||||||
|
|||||||
Reference in New Issue
Block a user