Skip to content

Commit

Permalink
Merge pull request #862 from newrelic/fix/nrql-condition-violation-ti…
Browse files Browse the repository at this point in the history
…me-limit

fix(nrql_alert_condition): add missing zeros to violation_time_limit_seconds to the new:old map
  • Loading branch information
sanderblue authored Sep 3, 2020
2 parents b478365 + 529852b commit 37a327c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion newrelic/resource_newrelic_nrql_alert_condition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ resource "newrelic_nrql_alert_condition" "foo" {
time_function = "any"
}
violation_time_limit_seconds = 3600
violation_time_limit_seconds = 86400
%[5]s
}
Expand Down
8 changes: 4 additions & 4 deletions newrelic/structures_newrelic_nrql_alert_condition.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ var (
violationTimeLimitMapNewOld = map[alerts.NrqlConditionViolationTimeLimit]int{
alerts.NrqlConditionViolationTimeLimits.OneHour: 3600,
alerts.NrqlConditionViolationTimeLimits.TwoHours: 7200,
alerts.NrqlConditionViolationTimeLimits.FourHours: 1440,
alerts.NrqlConditionViolationTimeLimits.EightHours: 2880,
alerts.NrqlConditionViolationTimeLimits.TwelveHours: 4320,
alerts.NrqlConditionViolationTimeLimits.TwentyFourHours: 8640,
alerts.NrqlConditionViolationTimeLimits.FourHours: 14400,
alerts.NrqlConditionViolationTimeLimits.EightHours: 28800,
alerts.NrqlConditionViolationTimeLimits.TwelveHours: 43200,
alerts.NrqlConditionViolationTimeLimits.TwentyFourHours: 86400,
}
)

Expand Down
4 changes: 2 additions & 2 deletions newrelic/structures_newrelic_nrql_alert_condition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ func TestExpandNrqlAlertConditionInput(t *testing.T) {
ExpectReason: "",
Expanded: expectedNrql,
},
"basline condition, requires baseline_direction attr": {
"baseline condition, requires baseline_direction attr": {
Data: map[string]interface{}{
"type": "baseline",
},
ExpectErr: true,
ExpectReason: "attribute `baseline_direction` is required for nrql alert conditions of type `baseline`",
},
"basline condition, has baseline_direction attr": {
"baseline condition, has baseline_direction attr": {
Data: map[string]interface{}{
"nrql": []interface{}{nrql},
"type": "baseline",
Expand Down

0 comments on commit 37a327c

Please sign in to comment.