docker stats app (#12358)

* docker stat app support

* Add missing doc and app

* stylci

* styleci

* styleci

* Add test data

* add snmpsim

* Update docker.inc.php

test with use Number::Bi

* typo

* Add tests

* Add tests

Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
This commit is contained in:
Lucas Dousse
2021-03-07 20:26:44 +01:00
committed by GitHub
parent b340a3eec4
commit 49868ee1a6
12 changed files with 465 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<?php
$name = 'docker';
$app_id = $app['app_id'];
$colours = 'mega';
$dostack = 0;
$printtotal = 0;
$addarea = 1;
$transparency = 15;
$unitlen = 20;
$bigdescrlen = 25;
$smalldescrlen = 25;
if (isset($vars['container'])) {
$containers = [$vars['container']];
} else {
$containers = get_arrays_with_application($device, $app['app_id'], 'docker');
}
$int = 0;
while (isset($containers[$int])) {
$container_name = $containers[$int];
$rrd_filename = rrd_name($device['hostname'], ['app', $name, $app_id, $container_name]);
if (rrdtool_check_rrd_exists($rrd_filename)) {
$rrd_list[] = [
'filename' => $rrd_filename,
'descr' => $container_name,
'ds' => $rrdVar,
];
}
$int++;
}
require 'includes/html/graphs/generic_multi_line_exact_numbers.inc.php';

View File

@@ -0,0 +1,7 @@
<?php
$unit_text = 'CPU (%)';
$rrdVar = 'cpu_usage';
$divider = 100;
require 'docker-common.inc.php';

View File

@@ -0,0 +1,6 @@
<?php
$unit_text = 'Memory Limit';
$rrdVar = 'mem_limit';
require 'docker-common.inc.php';

View File

@@ -0,0 +1,7 @@
<?php
$unit_text = 'Memory (%)';
$rrdVar = 'mem_perc';
$divider = 100;
require 'docker-common.inc.php';

View File

@@ -0,0 +1,6 @@
<?php
$unit_text = 'Memory used';
$rrdVar = 'mem_used';
require 'docker-common.inc.php';

View File

@@ -0,0 +1,6 @@
<?php
$unit_text = 'PIDs (count)';
$rrdVar = 'pids';
require 'docker-common.inc.php';