MCPcopy Create free account
hub / github.com/cortexproject/cortex / PostStore

Method PostStore

pkg/alertmanager/alertmanager.go:793–811  ·  view source on GitHub ↗
(alert *types.Alert, existing bool)

Source from the content-addressed store, hash-verified

791}
792
793func (a *alertsLimiter) PostStore(alert *types.Alert, existing bool) {
794 if alert == nil {
795 return
796 }
797
798 newSize := alertSize(alert.Alert)
799 fp := alert.Fingerprint()
800
801 a.mx.Lock()
802 defer a.mx.Unlock()
803
804 if existing {
805 a.totalSize -= a.sizes[fp]
806 } else {
807 a.count++
808 }
809 a.sizes[fp] = newSize
810 a.totalSize += newSize
811}
812
813func (a *alertsLimiter) PostDelete(alert *types.Alert) {
814 if alert == nil {

Callers 1

testLimiterFunction · 0.80

Calls 1

alertSizeFunction · 0.85

Tested by 1

testLimiterFunction · 0.64