bosun.org@v0.0.0-20210513094433-e25bc3e69a1f/cmd/scollector/collectors/fake.go (about) 1 package collectors 2 3 import ( 4 "strconv" 5 "time" 6 7 "bosun.org/metadata" 8 "bosun.org/opentsdb" 9 ) 10 11 func InitFake(fake int) { 12 collectors = append(collectors, &IntervalCollector{ 13 F: func() (opentsdb.MultiDataPoint, error) { 14 var md opentsdb.MultiDataPoint 15 for i := 0; i < fake; i++ { 16 Add(&md, "test.fake", i, opentsdb.TagSet{"i": strconv.Itoa(i)}, metadata.Unknown, metadata.None, "") 17 } 18 return md, nil 19 }, 20 Interval: time.Second, 21 name: "fake", 22 }) 23 }