![]() This is implemented as a loop over select, which either: As soon as a copier frees up, it flushes the batch (even if not full). Batches as much data as possible while waiting for a free copier.Initiates a read request to the copier on the copier read-request channel, sending a handle to the batcher's data-transfer channel.Creates an unbuffered data-transfer channel for this batcher.On the first new insert request, the metric batcher creates a metric table in the database, if it doesn't exist yet.įrom then onwards, when the metric batcher receives a new insert request on its channel it: These goroutines are created in dispatcher.InsertTs. The second stage consists of the metric batcher goroutines, one for each metric name. If asyncAcks=true, the dispatcher returns immediately, otherwise it waits for the metric batcher goroutine to return a result, and returns that in response. If the metric batcher does not exist yet, it is created on demand and lives forever. The dispatcher processes this map by iterating through the (key, value) pairs (which are metric name, and the insertable ( model.Insertable)), and sends it on a channel to the one metric batcher goroutine responsible for batching samples for that metric. ![]() The ingestor passes this map on to the dispatcher ( dispatcher.InsertTs(.)).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |