1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

make rate of periodic statistics configurable (closes #273)

This commit is contained in:
Steffen Vogel 2020-09-13 08:14:41 +02:00
parent 2014b8b61a
commit 85e9af4289
2 changed files with 6 additions and 2 deletions

View file

@ -73,6 +73,7 @@ protected:
int priority; /**< Process priority (lower is better) */
int affinity; /**< Process affinity of the server and all created threads */
int hugepages; /**< Number of hugepages to reserve. */
double statsRate; /**< Rate at which we display the periodic stats. */
struct Task task; /**< Task for periodic stats output */

View file

@ -62,6 +62,7 @@ SuperNode::SuperNode() :
priority(0),
affinity(0),
hugepages(DEFAULT_NR_HUGEPAGES),
statsRate(1.0),
task(CLOCK_REALTIME)
{
int ret;
@ -111,7 +112,8 @@ void SuperNode::parse(json_t *root)
json_error_t err;
ret = json_unpack_ex(root, &err, 0, "{ s?: o, s?: o, s?: o, s?: o, s?: i, s?: i, s?: i, s?: s, s?: b }",
ret = json_unpack_ex(root, &err, 0, "{ s?: F, s?: o, s?: o, s?: o, s?: o, s?: i, s?: i, s?: i, s?: s, s?: b }",
"stats", &statsRate,
"http", &json_http,
"logging", &json_logging,
"nodes", &json_nodes,
@ -386,7 +388,8 @@ void SuperNode::start()
startNodes();
startPaths();
task.setRate(1.0);
if (statsRate > 0) // A rate <0 will disable the periodic stats
task.setRate(statsRate);
Stats::printHeader(Stats::Format::HUMAN);