Commit 4fc260f7 authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Pre-populate graphs using ajax

parent e512f222
...@@ -125,6 +125,10 @@ EOF ...@@ -125,6 +125,10 @@ EOF
</legend> </legend>
EOF EOF
my $timespan = 900;
my $now = time();
my $startTimestamp = $now - $timespan;
# Menu setup # Menu setup
my $menu = [ my $menu = [
{ {
...@@ -219,15 +223,26 @@ EOF ...@@ -219,15 +223,26 @@ EOF
'Subscriptions' => [ 'Subscriptions' => [
sprintf('pool=%s:%s',$pool->{'InterfaceGroupID'},$pool->{'Name'}) sprintf('pool=%s:%s',$pool->{'InterfaceGroupID'},$pool->{'Name'})
] ]
},
{
'Type' => 'ajax',
'Subscriptions' => [
{
'Type' => 'pool',
'Data' => sprintf('%s:%s',$pool->{'InterfaceGroupID'},$pool->{'Name'}),
'StartTimestamp' => $startTimestamp,
'EndTimestamp' => $now
}
]
} }
], ],
'XIdentifiers' => [ 'XIdentifiers' => [
{ 'Name' => 'tx.cir', 'Label' => "TX Cir", 'Timespan' => 900 }, { 'Name' => 'tx.cir', 'Label' => "TX Cir", 'Timespan' => $timespan },
{ 'Name' => 'tx.limit', 'Label' => "TX Limit", 'Timespan' => 900 }, { 'Name' => 'tx.limit', 'Label' => "TX Limit", 'Timespan' => $timespan },
{ 'Name' => 'tx.rate', 'Label' => "TX Rate", 'Timespan' => 900 }, { 'Name' => 'tx.rate', 'Label' => "TX Rate", 'Timespan' => $timespan },
{ 'Name' => 'rx.cir', 'Label' => "RX Cir", 'Timespan' => 900 }, { 'Name' => 'rx.cir', 'Label' => "RX Cir", 'Timespan' => $timespan },
{ 'Name' => 'rx.limit', 'Label' => "RX Limit", 'Timespan' => 900 }, { 'Name' => 'rx.limit', 'Label' => "RX Limit", 'Timespan' => $timespan },
{ 'Name' => 'rx.rate', 'Label' => "RX Rate", 'Timespan' => 900 } { 'Name' => 'rx.rate', 'Label' => "RX Rate", 'Timespan' => $timespan }
] ]
}); });
} }
...@@ -468,6 +483,8 @@ EOF ...@@ -468,6 +483,8 @@ EOF
my @trafficClasses = sort(getAllTrafficClasses()); my @trafficClasses = sort(getAllTrafficClasses());
my $timespan = 900; my $timespan = 900;
my $now = time();
my $startTimestamp = $now - $timespan;
my @graphs; my @graphs;
my $graphCounter = 0; my $graphCounter = 0;
...@@ -486,6 +503,17 @@ EOF ...@@ -486,6 +503,17 @@ EOF
'Subscriptions' => [ 'Subscriptions' => [
sprintf('interface-group=%s',$interfaceGroupID), sprintf('interface-group=%s',$interfaceGroupID),
] ]
},
{
'Type' => 'ajax',
'Subscriptions' => [
{
'Type' => 'interface-group',
'Data' => $interfaceGroupID,
'StartTimestamp' => $startTimestamp,
'EndTimestamp' => $now
}
]
} }
], ],
'XIdentifiers' => [ 'XIdentifiers' => [
...@@ -583,6 +611,8 @@ EOF ...@@ -583,6 +611,8 @@ EOF
my @trafficClasses = sort(getAllTrafficClasses()); my @trafficClasses = sort(getAllTrafficClasses());
my $timespan = 900; my $timespan = 900;
my $now = time();
my $startTimestamp = $now - $timespan;
foreach my $trafficClassID (@trafficClasses) { foreach my $trafficClassID (@trafficClasses) {
my $trafficClass = getTrafficClass($trafficClassID); my $trafficClass = getTrafficClass($trafficClassID);
...@@ -598,6 +628,28 @@ EOF ...@@ -598,6 +628,28 @@ EOF
sprintf('class=%s:%s',$interfaceGroup->{'ID'},$trafficClassID), sprintf('class=%s:%s',$interfaceGroup->{'ID'},$trafficClassID),
sprintf('counter=configmanager.classpoolmembers.%s',$trafficClassID) sprintf('counter=configmanager.classpoolmembers.%s',$trafficClassID)
] ]
},
{
'Type' => 'ajax',
'Subscriptions' => [
{
'Type' => 'class',
'Data' => sprintf('%s:%s',$interfaceGroup->{'ID'},$trafficClassID),
'StartTimestamp' => $startTimestamp,
'EndTimestamp' => $now
}
]
},
{
'Type' => 'ajax',
'Subscriptions' => [
{
'Type' => 'counter',
'Data' => sprintf('configmanager.classpoolmembers.%s',$trafficClassID),
'StartTimestamp' => $startTimestamp,
'EndTimestamp' => $now
}
]
} }
], ],
'XIdentifiers' => [ 'XIdentifiers' => [
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment