Skip to content

Commit 1b0c0f9

Browse files
committed
stats output formatting
1 parent 826f88d commit 1b0c0f9

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

src/InfoLoggerDispatchStats.cxx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
#include "ConfigInfoLoggerServer.h"
3030
#include "infoLoggerMessage.h"
3131

32+
#define INDEX_SEPARATOR "_"
33+
3234
using namespace std::chrono;
3335

3436
////////////////////////////////////////////////////////
@@ -90,7 +92,7 @@ InfoLoggerDispatchStats::InfoLoggerDispatchStats(ConfigInfoLoggerServer* config,
9092
return; // invalid index name
9193
}
9294
lix.push_back(i);
93-
if (lix.size()>1) nix += "-";
95+
if (lix.size()>1) nix += INDEX_SEPARATOR;
9496
nix += name;
9597
}
9698
dPtr->ilgFieldsToIndex.push_back(std::pair(std::move(nix), std::move(lix)));
@@ -234,7 +236,7 @@ int InfoLoggerDispatchStats::customMessageProcess(std::shared_ptr<InfoLoggerMess
234236
for (int ii = 0 ; ii < (int)dPtr->ilgFieldsToIndex[id].second.size(); ii++) {
235237
if (debug) {printf(" get [%d]\n", dPtr->ilgFieldsToIndex[id].second[ii]);}
236238
if (ii) {
237-
v += "-";
239+
v += INDEX_SEPARATOR;
238240
}
239241
std::string fv = getStringValue(lmsg, dPtr->ilgFieldsToIndex[id].second[ii]);
240242
if (debug) {printf(" = %s\n",fv.c_str());}
@@ -434,7 +436,14 @@ int InfoLoggerDispatchStats::customLoop()
434436
};
435437

436438
std::string txt;
439+
bool isFirst = 1;
437440
for (const auto& [timestamp, window] : dPtr->windows) {
441+
if (isFirst) {
442+
isFirst = 0;
443+
} else {
444+
txt += " ";
445+
}
446+
438447
//txt += "{ " + std::to_string(timestamp) + " " + toTclList(window) + " }";
439448
txt += toTclList(window);
440449
}

0 commit comments

Comments
 (0)