MCPcopy
hub / github.com/prometheus/prometheus / Start

Method Start

storage/remote/queue_manager.go:970–988  ·  view source on GitHub ↗

Start the queue manager sending samples to the remote storage. Does not block.

()

Source from the content-addressed store, hash-verified

968// Start the queue manager sending samples to the remote storage.
969// Does not block.
970func (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.

Callers 15

TestReshardRaceWithStopFunction · 0.95
ServeHTTPMethod · 0.45
NewOTLPWriteHandlerFunction · 0.45
TestMetadataDeliveryFunction · 0.45
TestSampleDeliveryOrderFunction · 0.45
TestShutdownFunction · 0.45
TestReshardFunction · 0.45
TestReshardPartialBatchFunction · 0.45
TestQueueFilledDeadlockFunction · 0.45

Calls 6

updateShardsLoopMethod · 0.95
reshardLoopMethod · 0.95
registerMethod · 0.80
SetMethod · 0.65
AddMethod · 0.65
startMethod · 0.45

Tested by 15

TestReshardRaceWithStopFunction · 0.76
TestMetadataDeliveryFunction · 0.36
TestSampleDeliveryOrderFunction · 0.36
TestShutdownFunction · 0.36
TestReshardFunction · 0.36
TestReshardPartialBatchFunction · 0.36
TestQueueFilledDeadlockFunction · 0.36
TestShouldReshardFunction · 0.36
BenchmarkSampleSendFunction · 0.36