public void push ( List < Metric > rawMetrics ) { List < Metric > validMetrics = ValidCharacters . toValidValues ( filter ( rawMetrics ) ) ; List < Metric > metrics = transformMetrics ( validMetrics ) ; LOGGER . debug ( "Scheduling push of {} metrics" , metrics . size ( ) ) ; final UpdateTasks tasks = getUpdateTasks ( BasicTagList . EMPTY , identifyCountersForPush ( metrics ) ) ; final int maxAttempts = 5 ; int attempts = 1 ; while ( ! pushQueue . offer ( tasks ) && attempts <= maxAttempts ) { ++ attempts ; final UpdateTasks droppedTasks = pushQueue . remove ( ) ; LOGGER . warn ( "Removing old push task due to queue full. Dropping {} metrics." , droppedTasks . numMetrics ) ; numMetricsDroppedQueueFull . increment ( droppedTasks . numMetrics ) ; } if ( attempts >= maxAttempts ) { LOGGER . error ( "Unable to push update of {}" , tasks ) ; numMetricsDroppedQueueFull . increment ( tasks . numMetrics ) ; } else { LOGGER . debug ( "Queued push of {}" , tasks ) ; } }
Immediately send metrics to the backend .