From d3f3c127d1dae36bfd24f41ca7be174db9fd7edd Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Mon, 11 Feb 2019 16:32:39 +0100 Subject: [PATCH] super_node: remove stats setting --- include/villas/super_node.hpp | 1 - lib/super_node.cpp | 32 +++++++++++--------------------- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/include/villas/super_node.hpp b/include/villas/super_node.hpp index 370fcdbe1..2e58d1d7a 100644 --- a/include/villas/super_node.hpp +++ b/include/villas/super_node.hpp @@ -43,7 +43,6 @@ 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 stats; /**< Interval for path statistics. Set to 0 to disable them. */ Logger logger; diff --git a/lib/super_node.cpp b/lib/super_node.cpp index 011ce1f2c..216f71e6b 100644 --- a/lib/super_node.cpp +++ b/lib/super_node.cpp @@ -52,7 +52,6 @@ SuperNode::SuperNode() : priority(0), affinity(0), hugepages(DEFAULT_NR_HUGEPAGES), - stats(0), #ifdef WITH_API api(this), #ifdef WITH_WEB @@ -179,7 +178,7 @@ int SuperNode::parseJson(json_t *j) json_error_t err; - ret = json_unpack_ex(j, &err, 0, "{ s?: o, s?: o, s?: o, s?: o, s?: i, s?: i, s?: i, s?: F, s?: s }", + ret = json_unpack_ex(j, &err, 0, "{ s?: o, s?: o, s?: o, s?: o, s?: i, s?: i, s?: i, s?: s }", "http", &json_web, "logging", &json_logging, "nodes", &json_nodes, @@ -187,7 +186,6 @@ int SuperNode::parseJson(json_t *j) "hugepages", &hugepages, "affinity", &affinity, "priority", &priority, - "stats", &stats, "name", &nme ); if (ret) @@ -380,6 +378,8 @@ void SuperNode::startPaths() void SuperNode::start() { + int ret; + assert(state == STATE_CHECKED); memory_init(hugepages); @@ -398,17 +398,11 @@ void SuperNode::start() startNodes(); startPaths(); -#ifdef WITH_HOOKS - int ret; + ret = task_init(&task, 1.0, CLOCK_REALTIME); + if (ret) + throw RuntimeError("Failed to create timer"); - if (stats > 0) { - stats_print_header(STATS_FORMAT_HUMAN); - - ret = task_init(&task, 1.0 / stats, CLOCK_REALTIME); - if (ret) - throw RuntimeError("Failed to create stats timer"); - } -#endif /* WITH_HOOKS */ + stats_print_header(STATS_FORMAT_HUMAN); state = STATE_STARTED; } @@ -471,15 +465,11 @@ void SuperNode::stopInterfaces() void SuperNode::stop() { - -#ifdef WITH_HOOKS int ret; - if (stats > 0) { - ret = task_destroy(&task); - if (ret) - throw RuntimeError("Failed to stop stats timer"); - } -#endif /* WITH_HOOKS */ + + ret = task_destroy(&task); + if (ret) + throw RuntimeError("Failed to stop timer"); stopPaths(); stopNodes();