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
d7f11c30
Commit
d7f11c30
authored
Nov 07, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tech(alerting): set prev state when creating eval context
parent
489f087f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
pkg/services/alerting/eval_context.go
+7
-6
pkg/services/alerting/result_handler.go
+0
-2
No files found.
pkg/services/alerting/eval_context.go
View file @
d7f11c30
...
...
@@ -33,12 +33,13 @@ type EvalContext struct {
func
NewEvalContext
(
alertCtx
context
.
Context
,
rule
*
Rule
)
*
EvalContext
{
return
&
EvalContext
{
Ctx
:
alertCtx
,
StartTime
:
time
.
Now
(),
Rule
:
rule
,
Logs
:
make
([]
*
ResultLogEntry
,
0
),
EvalMatches
:
make
([]
*
EvalMatch
,
0
),
log
:
log
.
New
(
"alerting.evalContext"
),
Ctx
:
alertCtx
,
StartTime
:
time
.
Now
(),
Rule
:
rule
,
Logs
:
make
([]
*
ResultLogEntry
,
0
),
EvalMatches
:
make
([]
*
EvalMatch
,
0
),
log
:
log
.
New
(
"alerting.evalContext"
),
PrevAlertState
:
rule
.
State
,
}
}
...
...
pkg/services/alerting/result_handler.go
View file @
d7f11c30
...
...
@@ -59,8 +59,6 @@ func (handler *DefaultResultHandler) GetStateFromEvaluation(evalContext *EvalCon
}
func
(
handler
*
DefaultResultHandler
)
Handle
(
evalContext
*
EvalContext
)
error
{
evalContext
.
PrevAlertState
=
evalContext
.
Rule
.
State
executionError
:=
""
annotationData
:=
simplejson
.
New
()
...
...
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