PHP: ImageMagick / GraphicsMagick CPU kullanımını alın

0 Cevap php

PHP, ben CPU kullanımı ben çalıştırmak her ImagaMagick / GraphicsMagick yöntemin ne yakalayabilir bir yolu var mı? Bellek kullanımı çok güzel olurdu.

Temelde, ben her bir kütüphane benim uygulamada kullandığı ne kadar kaynak kriter çalışıyorum.

Başarısız girişimi:

exec('convert a.jpg a.png');

$result = array();

// Loop until process is detected
do
{
    exec('ps -eo comm,%cpu,%mem | grep ' . "convert", $result);
}
while($result === array());

// Display the changing CPU and memory usage of the process
do
{
    print_r($result);
    exec('ps -eo comm,%cpu,%mem | grep ' . "convert", $result);
}
while($result !== array());

0 Cevap