func (self *JSDivFingerprint) IsMatch(other counter.Countable) bool { othr, ok := other.(*JSDivFingerprint) if !ok { return false } if len(self.histogram) != len(othr.histogram) { glog.Error("Unexpected comparision between JSDivFingerprints") return false } s := self.calcSignificance(othr) return s < self.pValue }
func (self *RiemannNotifier) Notify(msg string, w *morgoth.Window) { tags := make([]string, 0, len(w.Tags)) for t, v := range w.Tags { tags = append(tags, fmt.Sprintf("%s=%s", t, v)) } event := &raidman.Event{ Service: w.Name, Host: "morgoth", State: "anomalous", Description: fmt.Sprintf("%s start: %v, stop: %v", msg, w.Start, w.Stop), Tags: tags, Time: w.Start.Unix(), Metric: int(w.Stop.Sub(w.Start)), Ttl: 30, } err := self.client.Send(event) if err != nil { glog.Error("Failed to send event Riemann", err) } }