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

made path statistics configurable via config file

git-svn-id: https://zerberus.eonerc.rwth-aachen.de:8443/svn/s2ss/trunk@211 8ec27952-4edc-4aab-86aa-e87bb2611832
This commit is contained in:
Steffen Vogel 2014-09-07 16:28:54 +00:00
parent 8bc886ee1e
commit 4962bae64e
4 changed files with 7 additions and 4 deletions

View file

@ -3,6 +3,7 @@
affinity = 0x02; # Mask of cores the server should run on
priority = 50; # Scheduler priority for the server
debug = 5; # The level of verbosity for debug messages
stats = 0.8; # The interval in seconds fo path statistics
nodes = {
acs = {

View file

@ -28,6 +28,8 @@ struct settings {
int affinity;
/** Debug log level */
int debug;
/** Interval for path statistics. Set to 0 to disable themo disable them. */
double stats;
/** A libconfig object pointing to the root of the config file */
config_setting_t *cfg;

View file

@ -68,6 +68,7 @@ int config_parse_global(config_setting_t *cfg, struct settings *set)
config_setting_lookup_int(cfg, "affinity", &set->affinity);
config_setting_lookup_int(cfg, "priority", &set->priority);
config_setting_lookup_int(cfg, "debug", &set->debug);
config_setting_lookup_float(cfg, "stats", &set->stats);
debug = set->debug;

View file

@ -194,20 +194,19 @@ int main(int argc, char *argv[])
/* Connect all nodes and start one thread per path */
start();
if (V >= 5) {
if (settings.stats > 0) {
struct path *p = paths;
info("");
info("Runtime Statistics:");
info("%12s " MAG("=>") " %-12s: %-8s %-8s %-8s %-8s %-8s",
"Source", "Destination", "#Sent", "#Recv", "#Delay", "#Dupl", "#Inval");
info("---------------------------------------------------------------------------");
while (1) {
sleep(1);
usleep(settings.stats * 1e6);
path_stats(p);
p = (p->next) ? p->next : paths;
p = (p->next) ? p->next : paths;
}
}
else