(reg prometheus.Registerer)
| 52 | } |
| 53 | |
| 54 | func startFireKeeper(reg prometheus.Registerer) { |
| 55 | firesMaintained := promauto.With(reg).NewCounter(prometheus.CounterOpts{ |
| 56 | Name: "fires_maintained_total", |
| 57 | Help: "Total number of fires maintained", |
| 58 | }) |
| 59 | |
| 60 | sparksDistributed := promauto.With(reg).NewCounter(prometheus.CounterOpts{ |
| 61 | Name: "sparks_distributed_total", |
| 62 | Help: "Total number of sparks distributed", |
| 63 | }) |
| 64 | |
| 65 | go func() { |
| 66 | for { |
| 67 | time.Sleep(5 * time.Second) |
| 68 | firesMaintained.Inc() |
| 69 | log.Println("FireKeeper maintained a fire") |
| 70 | } |
| 71 | }() |
| 72 | |
| 73 | go func() { |
| 74 | for { |
| 75 | time.Sleep(7 * time.Second) |
| 76 | sparksDistributed.Inc() |
| 77 | log.Println("FireKeeper distributed a spark") |
| 78 | } |
| 79 | }() |
| 80 | } |
| 81 | |
| 82 | func startSparkForge(reg prometheus.Registerer) { |
| 83 | itemsForged := promauto.With(reg).NewCounter(prometheus.CounterOpts{ |
no test coverage detected