Start the queue manager sending samples to the remote storage. Does not block.
()
| 968 | // Start the queue manager sending samples to the remote storage. |
| 969 | // Does not block. |
| 970 | func (t *QueueManager) Start() { |
| 971 | // Register and initialise some metrics. |
| 972 | t.metrics.register() |
| 973 | t.metrics.shardCapacity.Set(float64(t.cfg.Capacity)) |
| 974 | t.metrics.maxNumShards.Set(float64(t.cfg.MaxShards)) |
| 975 | t.metrics.minNumShards.Set(float64(t.cfg.MinShards)) |
| 976 | t.metrics.desiredNumShards.Set(float64(t.cfg.MinShards)) |
| 977 | t.metrics.maxSamplesPerSend.Set(float64(t.cfg.MaxSamplesPerSend)) |
| 978 | |
| 979 | t.shards.start(t.numShards) |
| 980 | t.watcher.Start() |
| 981 | if t.mcfg.Send { |
| 982 | t.metadataWatcher.Start() |
| 983 | } |
| 984 | |
| 985 | t.wg.Add(2) |
| 986 | go t.updateShardsLoop() |
| 987 | go t.reshardLoop() |
| 988 | } |
| 989 | |
| 990 | // Stop stops sending samples to the remote storage and waits for pending |
| 991 | // sends to complete. |