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:
parent
8bc886ee1e
commit
4962bae64e
4 changed files with 7 additions and 4 deletions
|
@ -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 = {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue