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
71f40655
Commit
71f40655
authored
Dec 19, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tech(alerting): remove comments
parent
ecf44d4d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
104 deletions
+0
-104
pkg/services/alerting/reader.go
+0
-15
pkg/services/alerting/reader_test.go
+0
-84
pkg/services/alerting/rule_test.go
+0
-5
No files found.
pkg/services/alerting/reader.go
View file @
71f40655
...
...
@@ -64,21 +64,6 @@ func (arr *DefaultRuleReader) Fetch() []*Rule {
}
func
(
arr
*
DefaultRuleReader
)
heartbeat
()
{
//Lets cheat on this until we focus on clustering
//log.Info("Heartbeat: Sending heartbeat from " + this.serverId)
arr
.
clusterSize
=
1
arr
.
serverPosition
=
1
/*
cmd := &m.HeartBeatCommand{ServerId: this.serverId}
err := bus.Dispatch(cmd)
if err != nil {
log.Error(1, "Failed to send heartbeat.")
} else {
this.clusterSize = cmd.Result.ClusterSize
this.serverPosition = cmd.Result.UptimePosition
}
*/
}
pkg/services/alerting/reader_test.go
deleted
100644 → 0
View file @
ecf44d4d
package
alerting
import
(
//m "github.com/grafana/grafana/pkg/models"
.
"github.com/smartystreets/goconvey/convey"
"testing"
)
func
TestAlertingScheduler
(
t
*
testing
.
T
)
{
Convey
(
"Testing alert job selection"
,
t
,
func
()
{
/*
mockFn := func() []m.AlertRule {
return []m.AlertRule{
{Id: 1, Title: "test 1"},
{Id: 2, Title: "test 2"},
{Id: 3, Title: "test 3"},
{Id: 4, Title: "test 4"},
{Id: 5, Title: "test 5"},
{Id: 6, Title: "test 6"},
}
}
Convey("single server", func() {
scheduler := &Scheduler{
jobs: make(map[int64]*AlertJob, 0),
runQueue: make(chan *AlertJob, 1000),
serverId: "",
serverPosition: 1,
clusterSize: 1,
}
scheduler.updateJobs(mockFn)
So(len(scheduler.jobs), ShouldEqual, 6)
})
Convey("two servers", func() {
scheduler := &Scheduler{
jobs: make(map[int64]*AlertJob, 0),
runQueue: make(chan *AlertJob, 1000),
serverId: "",
serverPosition: 1,
clusterSize: 2,
}
scheduler.updateJobs(mockFn)
So(len(scheduler.jobs), ShouldEqual, 3)
So(scheduler.jobs[1].rule.Id, ShouldEqual, 1)
})
Convey("six servers", func() {
scheduler := &Scheduler{
jobs: make(map[int64]*AlertJob, 0),
runQueue: make(chan *AlertJob, 1000),
serverId: "",
serverPosition: 6,
clusterSize: 6,
}
scheduler.updateJobs(mockFn)
So(len(scheduler.jobs), ShouldEqual, 1)
So(scheduler.jobs[6].rule.Id, ShouldEqual, 6)
})
Convey("more servers then alerts", func() {
mockFn := func() []m.AlertRule {
return []m.AlertRule{
{Id: 1, Title: "test 1"},
}
}
scheduler := &Scheduler{
jobs: make(map[int64]*AlertJob, 0),
runQueue: make(chan *AlertJob, 1000),
serverId: "",
serverPosition: 3,
clusterSize: 3,
}
scheduler.updateJobs(mockFn)
So(len(scheduler.jobs), ShouldEqual, 0)
})
*/
})
}
pkg/services/alerting/rule_test.go
View file @
71f40655
...
...
@@ -88,11 +88,6 @@ func TestAlertRuleModel(t *testing.T) {
Convey
(
"Can read notifications"
,
func
()
{
So
(
len
(
alertRule
.
Notifications
),
ShouldEqual
,
2
)
})
/*
Convey("Can read noDataMode", func() {
So(len(alertRule.NoDataMode), ShouldEqual, m.AlertStateCritical)
})
*/
})
})
}
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