Skip to content
Snippets Groups Projects
Commit 02fbdd68 authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Reworked processing of stats

parent 3147ded6
No related branches found
No related tags found
No related merge requests found
...@@ -231,26 +231,31 @@ sub task_child_stdout ...@@ -231,26 +231,31 @@ sub task_child_stdout
# Is this a system class? # Is this a system class?
# XXX: _class_parent is hard coded to 1 # XXX: _class_parent is hard coded to 1
if ($stat->{'_class_parent'} == 1 && (my $classChildDec = hex($stat->{'_class_child'})) < 100) { my $classChildDec = hex($stat->{'_class_child'});
if ($stat->{'_class_parent'} == 1) {
# Split off the different types of updates # Check if this is a limit class...
if ($classChildDec == 1) { if (opentrafficshaper::plugins::tc::isTcLimitClass($interface,1,$stat->{'_class_child'})) {
$sid = opentrafficshaper::plugins::statistics::getSIDFromCID($interface,0); if (defined(my $lid = opentrafficshaper::plugins::tc::getLIDFromTcLimitClass($interface,$stat->{'_class_child'}))) {
$sid = opentrafficshaper::plugins::statistics::getSIDFromLID($lid);
$direction = opentrafficshaper::plugins::statistics::getTrafficDirection($lid,$interface);
} else {
$logger->log(LOG_WARN,"[TCSTATS] Limit traffic class '%s:%s' NOT FOUND",$stat->{'_class_parent'},$stat->{'_class_child'});
}
} else { } else {
# Save the class with the decimal number # Class = 1 is the root
if (my $tcClass = opentrafficshaper::plugins::tc::isTcTrafficClassValid($interface,1,$stat->{'_class_child'})) { if ($classChildDec == 1) {
my $classID = hex($tcClass); # This is a special case case
$sid = opentrafficshaper::plugins::statistics::getSIDFromCID($interface,$classID); $sid = opentrafficshaper::plugins::statistics::getSIDFromCID($interface,0);
} else { } else {
$logger->log(LOG_WARN,"[TCSTATS] System traffic class '%s:%s' NOT FOUND",$stat->{'_class_parent'},$stat->{'_class_child'}); # Save the class with the decimal number
if (my $tcClass = opentrafficshaper::plugins::tc::isTcTrafficClassValid($interface,1,$stat->{'_class_child'})) {
my $classID = hex($tcClass);
$sid = opentrafficshaper::plugins::statistics::getSIDFromCID($interface,$classID);
} else {
$logger->log(LOG_WARN,"[TCSTATS] System traffic class '%s:%s' NOT FOUND",$stat->{'_class_parent'},$stat->{'_class_child'});
}
} }
} }
} else {
if (defined(my $lid = opentrafficshaper::plugins::tc::getLIDFromTcLimitClass($interface,$stat->{'_class_child'}))) {
$sid = opentrafficshaper::plugins::statistics::getSIDFromLID($lid);
$direction = opentrafficshaper::plugins::statistics::getTrafficDirection($lid,$interface);
}
} }
# Make sure we have the lid now # Make sure we have the lid now
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment