Files
librenms-librenms/includes/html/pages/device/apps/linux_softnet_stat.inc.php
Zane C. Bowers-Hadley 0ed68e33de add Linux Softnet Stat app (#15094)
* add linux_softnet_stat poller

* add graphs and app page for linux_softnet_stat

* fix polling

* rename a few items, clean up the app specific page, and add to the apps page

* convert from derive to counter

* save the budget and budget_usecs to app data

* display current value of the budgets

* now track budget values

* add tests data

* rename it

* add docs for Linux Softnet Stat

* re-order and add budget for app page graph order

* style fix

* correct data location

* fix metrics for the json
2023-06-11 16:37:55 +02:00

40 lines
1.3 KiB
PHP

<?php
$budget = $app->data['budget'] ?? 'unknown';
$budget_usecs = $app->data['budget_usecs'] ?? 'unknown';
print_optionbar_start();
echo 'Current Budget: ' . $budget . "<br>\nCurrent Budget usecs:" . $budget_usecs . "\n<br>";
print_optionbar_end();
$graphs = [
'linux_softnet_stat_packets' => 'Packets Per Second',
'linux_softnet_stat_time_squeeze' => 'Time Squeezes Per Second',
'linux_softnet_stat_backlog_length' => 'Backlog Lenght',
'linux_softnet_stat_packet_dropped' => 'Packets Dropped Per Second',
'linux_softnet_stat_cpu_collision' => 'CPU Collisions Per Second',
'linux_softnet_stat_flow_limit' => 'Flow Limit Hit Per Second',
'linux_softnet_stat_received_rps' => 'Received RPS Per Second',
'linux_softnet_stat_budget' => 'Budget Sysctl Values',
];
foreach ($graphs as $key => $text) {
$graph_type = $key;
$graph_array['height'] = '100';
$graph_array['width'] = '215';
$graph_array['to'] = \LibreNMS\Config::get('time.now');
$graph_array['id'] = $app['app_id'];
$graph_array['type'] = 'application_' . $key;
echo '<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">' . $text . '</h3>
</div>
<div class="panel-body">
<div class="row">';
include 'includes/html/print-graphrow.inc.php';
echo '</div>';
echo '</div>';
echo '</div>';
}