Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
8ac635b6
Commit
8ac635b6
authored
May 26, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style(alerting): change const names
parent
957cb407
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
pkg/models/alerts_state.go
+10
-10
pkg/services/alerting/graphite_executor.go
+5
-5
No files found.
pkg/models/alerts_state.go
View file @
8ac635b6
...
...
@@ -15,18 +15,18 @@ type AlertState struct {
var
(
VALID_STATES
=
[]
string
{
A
LERT_STATE_OK
,
A
LERT_STATE_WARN
,
A
LERT_STATE_CRITICAL
,
A
LERT_STATE_ACKNOWLEDGED
,
A
LERT_STATE_MAINTENANCE
,
A
lertStateOk
,
A
lertStateWarn
,
A
lertStateCritical
,
A
lertStateAcknowledged
,
A
lertStateMaintenance
,
}
A
LERT_STATE_OK
=
"OK"
A
LERT_STATE_WARN
=
"WARN"
A
LERT_STATE_CRITICAL
=
"CRITICAL"
A
LERT_STATE_ACKNOWLEDGED
=
"ACKNOWLEDGED"
A
LERT_STATE_MAINTENANCE
=
"MAINTENANCE"
A
lertStateOk
=
"OK"
A
lertStateWarn
=
"WARN"
A
lertStateCritical
=
"CRITICAL"
A
lertStateAcknowledged
=
"ACKNOWLEDGED"
A
lertStateMaintenance
=
"MAINTENANCE"
)
func
(
this
*
UpdateAlertStateCommand
)
IsValidState
()
bool
{
...
...
pkg/services/alerting/graphite_executor.go
View file @
8ac635b6
...
...
@@ -44,23 +44,23 @@ func (this *GraphiteExecutor) executeRules(series []Series, rule m.AlertRule) *A
avg
=
sum
/
float64
(
len
(
v
.
Datapoints
))
if
float64
(
rule
.
CritLevel
)
<
avg
{
return
&
AlertResult
{
State
:
m
.
A
LERT_STATE_CRITICAL
,
Id
:
rule
.
Id
,
ActualValue
:
avg
}
return
&
AlertResult
{
State
:
m
.
A
lertStateCritical
,
Id
:
rule
.
Id
,
ActualValue
:
avg
}
}
if
float64
(
rule
.
WarnLevel
)
<
avg
{
return
&
AlertResult
{
State
:
m
.
A
LERT_STATE_WARN
,
Id
:
rule
.
Id
,
ActualValue
:
avg
}
return
&
AlertResult
{
State
:
m
.
A
lertStateWarn
,
Id
:
rule
.
Id
,
ActualValue
:
avg
}
}
if
float64
(
rule
.
CritLevel
)
<
sum
{
return
&
AlertResult
{
State
:
m
.
A
LERT_STATE_CRITICAL
,
Id
:
rule
.
Id
,
ActualValue
:
sum
}
return
&
AlertResult
{
State
:
m
.
A
lertStateCritical
,
Id
:
rule
.
Id
,
ActualValue
:
sum
}
}
if
float64
(
rule
.
WarnLevel
)
<
sum
{
return
&
AlertResult
{
State
:
m
.
A
LERT_STATE_WARN
,
Id
:
rule
.
Id
,
ActualValue
:
sum
}
return
&
AlertResult
{
State
:
m
.
A
lertStateWarn
,
Id
:
rule
.
Id
,
ActualValue
:
sum
}
}
}
return
&
AlertResult
{
State
:
m
.
A
LERT_STATE_OK
,
Id
:
rule
.
Id
}
return
&
AlertResult
{
State
:
m
.
A
lertStateOk
,
Id
:
rule
.
Id
}
}
func
(
this
*
GraphiteExecutor
)
getSeries
(
rule
m
.
AlertRule
)
(
Response
,
error
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment