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

test_rtt: Improve statistics

Signed-off-by: Steffen Vogel <post@steffenvogel.de>
This commit is contained in:
Steffen Vogel 2024-05-27 18:09:31 +02:00 committed by pipeacosta
parent f75bf8536c
commit 19982bf49b
2 changed files with 15 additions and 10 deletions

View file

@ -33,15 +33,16 @@ protected:
warmup; // Number of seconds to wait between before recording samples.
double cooldown; // Number of seconds to wait between tests.
unsigned values;
unsigned missed;
unsigned limit; // The number of samples we send per test.
unsigned sent;
unsigned received;
unsigned missed;
unsigned limit_warmup; // The number of samples we send during warmup.
unsigned sent_warmup;
unsigned received_warmup;
unsigned missed_warmup;
struct timespec started;
struct timespec stopped;
@ -55,8 +56,8 @@ protected:
Case(TestRTT *n, int id, int rate, float warmup, float cooldown, int values,
int limit, int limit_warmup, const std::string &filename)
: node(n), id(id), rate(rate), warmup(warmup), cooldown(cooldown),
values(values), missed(0), limit(limit), sent(0), received(0),
limit_warmup(limit_warmup), sent_warmup(0), received_warmup(0),
values(values), limit(limit), sent(0), received(0), missed(0),
limit_warmup(limit_warmup), sent_warmup(0), received_warmup(0), missed_warmup(0),
filename(filename){};
int start();

View file

@ -26,7 +26,7 @@ static SuperNode *sn = nullptr;
int TestRTT::Case::start() {
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,
values, limit, warmup, cooldown);
@ -59,7 +59,7 @@ int TestRTT::Case::stop() {
if (ret)
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;
}
@ -68,15 +68,15 @@ json_t *TestRTT::Case::getMetadata() {
json_t *json_warmup = nullptr;
if (limit_warmup > 0) {
json_warmup = json_pack("{ s: i, s: i, s: i }", "limit", limit_warmup,
"sent", sent_warmup, "received", received_warmup);
json_warmup = json_pack("{ s: i, s: i, s: i, s: i }", "limit", limit_warmup,
"sent", sent_warmup, "received", received_warmup, "missed", missed_warmup);
}
return json_pack(
"{ 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),
"stopped", time_to_double(&stopped), "missed", missed, "limit", limit,
"sent", sent, "received", received, "warmup", json_warmup);
"stopped", time_to_double(&stopped), "limit", limit,
"sent", sent, "received", received, "missed", missed, "warmup", json_warmup);
}
int TestRTT::prepare() {
@ -296,7 +296,11 @@ int TestRTT::_read(struct Sample *smps[], unsigned cnt) {
auto steps = task.wait();
if (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..