mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 19:53:29 +02:00
use the stashValue helper to send the audio-mixer stat
This commit is contained in:
parent
8b7b0d542a
commit
72f7db2ec7
1 changed files with 1 additions and 8 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue