Simulation replay profiling graph overhaul.

Support multiple graphs with different scales, units, rounding and
descriptions and use it for memory allocation and number of garbage
collections.
Have the X axis in number of turns (instead of that divided by 20).
Don't have the legend hide part of the graph.
Add references to that hardcoded 20.
Move graph JS to a separate JS file.
Use JSON instead of JS.
Add legal html structure.

Comments By: Vladislav in irc yesterday
This was SVN commit r21602.
This commit is contained in:
elexis
2018-03-22 13:53:04 +00:00
parent fcceffb3dd
commit ee9e677084
4 changed files with 177 additions and 65 deletions
+7 -3
View File
@@ -42,6 +42,12 @@
#include <ctime>
#include <fstream>
/**
* Number of turns between two saved profiler snapshots.
* Keep in sync with source/tools/replayprofile/graph.js
*/
static const int PROFILE_TURN_INTERVAL = 20;
CReplayLogger::CReplayLogger(const ScriptInterface& scriptInterface) :
m_ScriptInterface(scriptInterface), m_Stream(NULL)
{
@@ -234,13 +240,11 @@ void CReplayPlayer::Replay(bool serializationtest, int rejointestturn, bool oosl
g_Profiler.Frame();
if (turn % 20 == 0)
if (turn % PROFILE_TURN_INTERVAL == 0)
g_ProfileViewer.SaveToFile();
}
else
{
debug_printf("Unrecognised replay token %s\n", type.c_str());
}
}
}