Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collect stats about sizes of different types of messages sent in JITServer #9752

Merged
merged 1 commit into from
Jun 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions runtime/compiler/control/JITServerHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
#include "control/JITServerCompilationThread.hpp"
#include "control/MethodToBeCompiled.hpp"
#include "infra/CriticalSection.hpp"
#include "infra/Statistics.hpp"
#include "net/CommunicationStream.hpp"



uint32_t JITServerHelpers::serverMsgTypeCount[] = {};
Expand Down Expand Up @@ -123,12 +126,22 @@ JITServerHelpers::printJITServerMsgStats(J9JITConfig *jitConfig)
int totalMsgCount = 0;
PORT_ACCESS_FROM_JITCONFIG(jitConfig);
j9tty_printf(PORTLIB, "JITServer Message Type Statistics:\n");
j9tty_printf(PORTLIB, "Type# #called TypeName\n");
j9tty_printf(PORTLIB, "Type# #called");
#ifdef MESSAGE_SIZE_STATS
j9tty_printf(PORTLIB, "\t\tMax\t\tMin\t\tMean\t\tStdDev\t\tSum");
#endif
j9tty_printf(PORTLIB, "\t\tTypeName\n");
for (int i = 0; i < JITServer::MessageType_ARRAYSIZE; ++i)
{
if (JITServerHelpers::serverMsgTypeCount[i] > 0)
{
j9tty_printf(PORTLIB, "#%04d %7u %s\n", i, JITServerHelpers::serverMsgTypeCount[i], JITServer::messageNames[i]);
j9tty_printf(PORTLIB, "#%04d %7u", i, JITServerHelpers::serverMsgTypeCount[i]);
#ifdef MESSAGE_SIZE_STATS
j9tty_printf(PORTLIB, "\t%f\t%f\t%f\t%f\t%f", JITServer::CommunicationStream::collectMsgStat[i].maxVal(),
JITServer::CommunicationStream::collectMsgStat[i].minVal(), JITServer::CommunicationStream::collectMsgStat[i].mean(),
JITServer::CommunicationStream::collectMsgStat[i].stddev(), JITServer::CommunicationStream::collectMsgStat[i].sum());
#endif
j9tty_printf(PORTLIB, "\t\t%s\n", JITServer::messageNames[i]);
totalMsgCount += JITServerHelpers::serverMsgTypeCount[i];
}
}
Expand Down
8 changes: 8 additions & 0 deletions runtime/compiler/net/CommunicationStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
namespace JITServer
{
uint32_t CommunicationStream::CONFIGURATION_FLAGS = 0;
#ifdef MESSAGE_SIZE_STATS
TR_Stats JITServer::CommunicationStream::collectMsgStat[];
#endif

void
CommunicationStream::initConfigurationFlags()
Expand Down Expand Up @@ -73,6 +76,11 @@ CommunicationStream::readMessage(Message &msg)

// rebuild the message
msg.deserialize();

// collect message size
#ifdef MESSAGE_SIZE_STATS
collectMsgStat[int(msg.type())].update(messageSize);
#endif
}

void
Expand Down
5 changes: 5 additions & 0 deletions runtime/compiler/net/CommunicationStream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <openssl/err.h>
#include "net/LoadSSLLibs.hpp"
#include "net/Message.hpp"
#include "infra/Statistics.hpp"


namespace JITServer
Expand All @@ -43,6 +44,10 @@ class CommunicationStream
public:
static bool useSSL();
static void initSSL();

#ifdef MESSAGE_SIZE_STATS
static TR_Stats collectMsgStat[JITServer::MessageType_ARRAYSIZE];
#endif

static void initConfigurationFlags();

Expand Down