From 72f7db2ec7919cceebf13447226c7e1a3e9c310f Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 20 Jun 2013 15:35:39 -0700 Subject: [PATCH] use the stashValue helper to send the audio-mixer stat --- audio-mixer/src/main.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/audio-mixer/src/main.cpp b/audio-mixer/src/main.cpp index c19aba0a9c..5f9b79264c 100644 --- a/audio-mixer/src/main.cpp +++ b/audio-mixer/src/main.cpp @@ -137,15 +137,8 @@ int main(int argc, const char* argv[]) { // if we should be sending stats to Logstash send the appropriate average now const char MIXER_LOGSTASH_METRIC_NAME[] = "audio-mixer-frame-time-usage"; - // we're sending a floating point percentage with two mandatory numbers after decimal point - // that could be up to 6 bytes - const int MIXER_LOGSTASH_PACKET_BYTES = strlen(MIXER_LOGSTASH_METRIC_NAME) + 7; - char logstashPacket[MIXER_LOGSTASH_PACKET_BYTES]; - float averageFrameTimePercentage = sumFrameTimePercentages / numStatCollections; - int packetBytes = sprintf(logstashPacket, "%s %.2f", MIXER_LOGSTASH_METRIC_NAME, averageFrameTimePercentage); - - agentList->getAgentSocket()->send(Logstash::socket(), logstashPacket, packetBytes); + Logstash::stashValue(MIXER_LOGSTASH_METRIC_NAME, averageFrameTimePercentage); sumFrameTimePercentages = 0.0f; numStatCollections = 0;