mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-30 00:00:11 +01:00
test_rtt: Improve statistics
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
This commit is contained in:
parent
139101c447
commit
64749223e8
2 changed files with 15 additions and 10 deletions
|
@ -33,15 +33,16 @@ protected:
|
||||||
warmup; // Number of seconds to wait between before recording samples.
|
warmup; // Number of seconds to wait between before recording samples.
|
||||||
double cooldown; // Number of seconds to wait between tests.
|
double cooldown; // Number of seconds to wait between tests.
|
||||||
unsigned values;
|
unsigned values;
|
||||||
unsigned missed;
|
|
||||||
|
|
||||||
unsigned limit; // The number of samples we send per test.
|
unsigned limit; // The number of samples we send per test.
|
||||||
unsigned sent;
|
unsigned sent;
|
||||||
unsigned received;
|
unsigned received;
|
||||||
|
unsigned missed;
|
||||||
|
|
||||||
unsigned limit_warmup; // The number of samples we send during warmup.
|
unsigned limit_warmup; // The number of samples we send during warmup.
|
||||||
unsigned sent_warmup;
|
unsigned sent_warmup;
|
||||||
unsigned received_warmup;
|
unsigned received_warmup;
|
||||||
|
unsigned missed_warmup;
|
||||||
|
|
||||||
struct timespec started;
|
struct timespec started;
|
||||||
struct timespec stopped;
|
struct timespec stopped;
|
||||||
|
@ -55,8 +56,8 @@ protected:
|
||||||
Case(TestRTT *n, int id, int rate, float warmup, float cooldown, int values,
|
Case(TestRTT *n, int id, int rate, float warmup, float cooldown, int values,
|
||||||
int limit, int limit_warmup, const std::string &filename)
|
int limit, int limit_warmup, const std::string &filename)
|
||||||
: node(n), id(id), rate(rate), warmup(warmup), cooldown(cooldown),
|
: node(n), id(id), rate(rate), warmup(warmup), cooldown(cooldown),
|
||||||
values(values), missed(0), limit(limit), sent(0), received(0),
|
values(values), limit(limit), sent(0), received(0), missed(0),
|
||||||
limit_warmup(limit_warmup), sent_warmup(0), received_warmup(0),
|
limit_warmup(limit_warmup), sent_warmup(0), received_warmup(0), missed_warmup(0),
|
||||||
filename(filename){};
|
filename(filename){};
|
||||||
|
|
||||||
int start();
|
int start();
|
||||||
|
|
|
@ -26,7 +26,7 @@ static SuperNode *sn = nullptr;
|
||||||
|
|
||||||
int TestRTT::Case::start() {
|
int TestRTT::Case::start() {
|
||||||
node->logger->info("Starting case #{}/{}: filename={}, rate={}/s, values={}, "
|
node->logger->info("Starting case #{}/{}: filename={}, rate={}/s, values={}, "
|
||||||
"limit={}smps, warmup={}s, cooldown={}s",
|
"limit={}smps, warmup={:.3f}s, cooldown={:.3f}s",
|
||||||
id + 1, node->cases.size(), filename_formatted, rate,
|
id + 1, node->cases.size(), filename_formatted, rate,
|
||||||
values, limit, warmup, cooldown);
|
values, limit, warmup, cooldown);
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ int TestRTT::Case::stop() {
|
||||||
if (ret)
|
if (ret)
|
||||||
throw SystemError("Failed to close file");
|
throw SystemError("Failed to close file");
|
||||||
|
|
||||||
node->logger->info("Stopping case #{}/{}: sent={}, received={}, duration={:.2}", id + 1, node->cases.size(), sent, received, time_delta(&started, &stopped));
|
node->logger->info("Stopping case #{}/{}: limit={}smps, sent={}smps, received={}smps, missed={}smps, duration={:.3f}s", id + 1, node->cases.size(), limit, sent, received, missed, time_delta(&started, &stopped));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -68,15 +68,15 @@ json_t *TestRTT::Case::getMetadata() {
|
||||||
json_t *json_warmup = nullptr;
|
json_t *json_warmup = nullptr;
|
||||||
|
|
||||||
if (limit_warmup > 0) {
|
if (limit_warmup > 0) {
|
||||||
json_warmup = json_pack("{ s: i, s: i, s: i }", "limit", limit_warmup,
|
json_warmup = json_pack("{ s: i, s: i, s: i, s: i }", "limit", limit_warmup,
|
||||||
"sent", sent_warmup, "received", received_warmup);
|
"sent", sent_warmup, "received", received_warmup, "missed", missed_warmup);
|
||||||
}
|
}
|
||||||
|
|
||||||
return json_pack(
|
return json_pack(
|
||||||
"{ s: i, s: f, s: i, s: f, s: f, s: i, s: i, s: i, s: i, s: o* }", "id",
|
"{ s: i, s: f, s: i, s: f, s: f, s: i, s: i, s: i, s: i, s: o* }", "id",
|
||||||
id, "rate", rate, "values", values, "started", time_to_double(&started),
|
id, "rate", rate, "values", values, "started", time_to_double(&started),
|
||||||
"stopped", time_to_double(&stopped), "missed", missed, "limit", limit,
|
"stopped", time_to_double(&stopped), "limit", limit,
|
||||||
"sent", sent, "received", received, "warmup", json_warmup);
|
"sent", sent, "received", received, "missed", missed, "warmup", json_warmup);
|
||||||
}
|
}
|
||||||
|
|
||||||
int TestRTT::prepare() {
|
int TestRTT::prepare() {
|
||||||
|
@ -296,7 +296,11 @@ int TestRTT::_read(struct Sample *smps[], unsigned cnt) {
|
||||||
auto steps = task.wait();
|
auto steps = task.wait();
|
||||||
if (steps > 1) {
|
if (steps > 1) {
|
||||||
logger->warn("Skipped {} steps", steps - 1);
|
logger->warn("Skipped {} steps", steps - 1);
|
||||||
current->missed += steps - 1;
|
|
||||||
|
if (current->sent_warmup < current->limit_warmup)
|
||||||
|
current->missed_warmup += steps - 1;
|
||||||
|
else
|
||||||
|
current->missed += steps - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cooldown of case completed..
|
// Cooldown of case completed..
|
||||||
|
|
Loading…
Add table
Reference in a new issue