mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 09:38:23 +01:00
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
49 lines
903 B
PHP
49 lines
903 B
PHP
<?php
|
|
|
|
use \DebugBar\DataCollector\MemoryCollector;
|
|
|
|
/**
|
|
* DolMemoryCollector class
|
|
*/
|
|
|
|
class DolMemoryCollector extends MemoryCollector
|
|
{
|
|
/**
|
|
* Return value of indicator
|
|
*
|
|
* @return void
|
|
*/
|
|
public function collect()
|
|
{
|
|
global $conf, $langs;
|
|
|
|
$this->updatePeakUsage();
|
|
return array(
|
|
'peak_usage' => $this->peakUsage,
|
|
//'peak_usage_str' => $this->getDataFormatter()->formatBytes($this->peakUsage, 2)
|
|
'peak_usage_str' => (empty($conf->dol_optimize_smallscreen) ? dol_print_size($this->peakUsage, 0) : dol_print_size($this->peakUsage, 1))
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Return widget settings
|
|
*
|
|
* @return void
|
|
*/
|
|
public function getWidgets()
|
|
{
|
|
global $langs;
|
|
|
|
$langs->load("other");
|
|
|
|
return array(
|
|
"memory" => array(
|
|
"icon" => "cogs",
|
|
"tooltip" => $langs->transnoentities('MemoryUsage'),
|
|
"map" => "memory.peak_usage_str",
|
|
"default" => "'0B'"
|
|
)
|
|
);
|
|
}
|
|
}
|