Skip to content

Commit

Permalink
Remove generic set type
Browse files Browse the repository at this point in the history
  • Loading branch information
fabxc committed Jun 1, 2015
1 parent dbc0d30 commit 02717e6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 184 deletions.
7 changes: 3 additions & 4 deletions rules/alerting.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (

"github.com/prometheus/prometheus/pkg/strutil"
"github.com/prometheus/prometheus/promql"
"github.com/prometheus/prometheus/utility"
)

const (
Expand Down Expand Up @@ -149,10 +148,10 @@ func (rule *AlertingRule) Eval(timestamp clientmodel.Timestamp, engine *promql.E

// Create pending alerts for any new vector elements in the alert expression
// or update the expression value for existing elements.
resultFingerprints := utility.Set{}
resultFPs := map[clientmodel.Fingerprint]struct{}{}
for _, sample := range exprResult {
fp := sample.Metric.Metric.Fingerprint()
resultFingerprints.Add(fp)
resultFPs[fp] = struct{}{}

if alert, ok := rule.activeAlerts[fp]; !ok {
labels := clientmodel.LabelSet{}
Expand All @@ -177,7 +176,7 @@ func (rule *AlertingRule) Eval(timestamp clientmodel.Timestamp, engine *promql.E

// Check if any pending alerts should be removed or fire now. Write out alert timeseries.
for fp, activeAlert := range rule.activeAlerts {
if !resultFingerprints.Has(fp) {
if _, ok := resultFPs[fp]; !ok {
vector = append(vector, activeAlert.sample(timestamp, 0))
delete(rule.activeAlerts, fp)
continue
Expand Down
58 changes: 0 additions & 58 deletions utility/set.go

This file was deleted.

122 changes: 0 additions & 122 deletions utility/set_test.go

This file was deleted.

0 comments on commit 02717e6

Please sign in to comment.