When Ruby stats are printed for events and transitions, they include stats
for all of the controllers of the same type, but they are not necessarily
printed in order of the controller ID "version", because of the way the
profilers were added to the profiler vector. This patch fixes the push order
problem so that the stats are printed in ascending order 0->(# controllers),
so statistics parsers may correctly assume the controller to which the stats
belong.
void
${ident}_ProfileDumper::registerProfiler(${ident}_Profiler* profiler)
{
- m_profilers.push_back(profiler);
+ if (profiler->getVersion() >= m_profilers.size())
+ m_profilers.resize(profiler->getVersion() + 1);
+ m_profilers[profiler->getVersion()] = profiler;
}
void
public:
${ident}_Profiler();
void setVersion(int version);
+ int getVersion();
void countTransition(${ident}_State state, ${ident}_Event event);
void possibleTransition(${ident}_State state, ${ident}_Event event);
uint64 getEventCount(${ident}_Event event);
m_version = version;
}
+int
+${ident}_Profiler::getVersion()
+{
+ return m_version;
+}
+
void
${ident}_Profiler::clearStats()
{