Skip to content

Instantly share code, notes, and snippets.

View claudio-benfatto's full-sized avatar

Claudio Benfatto claudio-benfatto

View GitHub Profile
@claudio-benfatto
claudio-benfatto / carbonserver.go
Created July 7, 2017 14:02
carbonserver proposed fix
func (listener *CarbonserverListener) updateAccessedMetrics(details map[string]*pb.MetricDetails) map[string]struct{} {
fidx := listener.CurrentFileIndex()
accessedMetrics := make(map[string]struct{})
if fidx != nil {
fidx.Lock()
defer fidx.Unlock()
for m := range fidx.accessedMetrics {
accessedMetrics[m] = struct{}{}
}
package main_test
import (
"time"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/jriguera/metron-throughput/receiver"