MCPcopy
hub / github.com/prometheus/prometheus / Stop

Method Stop

storage/remote/queue_manager.go:992–1007  ·  view source on GitHub ↗

Stop stops sending samples to the remote storage and waits for pending sends to complete.

()

Source from the content-addressed store, hash-verified

990// Stop stops sending samples to the remote storage and waits for pending
991// sends to complete.
992func (t *QueueManager) Stop() {
993 t.logger.Info("Stopping remote storage...")
994 defer t.logger.Info("Remote storage stopped.")
995
996 close(t.quit)
997 // Wait for all QueueManager routines to end before stopping shards, metadata watcher, and WAL watcher. This
998 // is to ensure we don't end up executing a reshard and shards.stop() at the same time, which
999 // causes a closed channel panic.
1000 t.wg.Wait()
1001 t.shards.stop()
1002 t.watcher.Stop()
1003 if t.mcfg.Send {
1004 t.metadataWatcher.Stop()
1005 }
1006 t.metrics.unregister()
1007}
1008
1009// StoreSeries keeps track of which series we know about for lookups when sending samples to remote.
1010func (t *QueueManager) StoreSeries(series []record.RefSeries, index int) {

Callers 15

TestReshardRaceWithStopFunction · 0.95
CloseMethod · 0.45
TestMetadataDeliveryFunction · 0.45
TestSampleDeliveryOrderFunction · 0.45
TestShutdownFunction · 0.45
TestReshardFunction · 0.45
TestReshardPartialBatchFunction · 0.45
TestQueueFilledDeadlockFunction · 0.45
TestShouldReshardFunction · 0.45

Calls 2

unregisterMethod · 0.80
stopMethod · 0.65

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