(cobra metrics to statsd bot) send info about memory warnings

This commit is contained in:
Benjamin Sergeant 2020-06-19 17:46:59 -07:00
parent aae2402ed2
commit 78713895dd
3 changed files with 27 additions and 1 deletions

View File

@ -1,6 +1,10 @@
# Changelog
All changes to this project will be documented in this file.
## [9.8.0] - 2020-06-19
(cobra metrics to statsd bot) send info about memory warnings
## [9.7.9] - 2020-06-18
(http client) fix deadlock when following redirects

View File

@ -33,6 +33,24 @@ namespace
namespace ix
{
bool processMemoryWarningsMetricsEvent(const Json::Value& msg,
StatsdClient& statsdClient)
{
auto startTime = msg["device"]["start_time"].asUInt64();
auto timestamp = msg["timestamp"].asUInt64();
auto game = msg["device"]["game"].asString();
std::stringstream ss;
ss << msg["id"].asString() << "."
<< game;
std::string id = ss.str();
statsdClient.timing(id, (timestamp - startTime) / 1000);
return true;
}
bool processNetRequestMetricsEvent(const Json::Value& msg,
StatsdClient& statsdClient)
{
@ -216,6 +234,10 @@ namespace ix
{
success = processNetRequestMetricsEvent(msg, statsdClient);
}
else if (msg["id"].asString() == "engine_memory_warning_id")
{
success = processMemoryWarningsMetricsEvent(msg, statsdClient);
}
if (success) sentCount++;
});

View File

@ -6,4 +6,4 @@
#pragma once
#define IX_WEBSOCKET_VERSION "9.7.9"
#define IX_WEBSOCKET_VERSION "9.8.0"