ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
Twig_Profiler_Dumper_Blackfire Class Reference
+ Collaboration diagram for Twig_Profiler_Dumper_Blackfire:

Public Member Functions

 dump (Twig_Profiler_Profile $profile)
 

Private Member Functions

 dumpChildren ($parent, Twig_Profiler_Profile $profile, &$data)
 
 dumpProfile ($edge, Twig_Profiler_Profile $profile, &$data)
 

Detailed Description

Author
Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com

@final

Definition at line 17 of file Blackfire.php.

Member Function Documentation

◆ dump()

Twig_Profiler_Dumper_Blackfire::dump ( Twig_Profiler_Profile  $profile)

Definition at line 19 of file Blackfire.php.

20 {
21 $data = array();
22 $this->dumpProfile('main()', $profile, $data);
23 $this->dumpChildren('main()', $profile, $data);
24
25 $start = sprintf('%f', microtime(true));
26 $str = <<<EOF
27file-format: BlackfireProbe
28cost-dimensions: wt mu pmu
29request-start: {$start}
30
31
32EOF;
33
34 foreach ($data as $name => $values) {
35 $str .= "{$name}//{$values['ct']} {$values['wt']} {$values['mu']} {$values['pmu']}\n";
36 }
37
38 return $str;
39 }
sprintf('%.4f', $callTime)
const EOF
How fgetc() reports an End Of File.
Definition: JSMin_lib.php:92
dumpProfile($edge, Twig_Profiler_Profile $profile, &$data)
Definition: Blackfire.php:54
dumpChildren($parent, Twig_Profiler_Profile $profile, &$data)
Definition: Blackfire.php:41
if($format !==null) $name
Definition: metadata.php:146

References $data, $name, dumpChildren(), dumpProfile(), EOF, and sprintf.

+ Here is the call graph for this function:

◆ dumpChildren()

Twig_Profiler_Dumper_Blackfire::dumpChildren (   $parent,
Twig_Profiler_Profile  $profile,
$data 
)
private

Definition at line 41 of file Blackfire.php.

42 {
43 foreach ($profile as $p) {
44 if ($p->isTemplate()) {
45 $name = $p->getTemplate();
46 } else {
47 $name = sprintf('%s::%s(%s)', $p->getTemplate(), $p->getType(), $p->getName());
48 }
49 $this->dumpProfile(sprintf('%s==>%s', $parent, $name), $p, $data);
50 $this->dumpChildren($name, $p, $data);
51 }
52 }

References $data, $name, dumpChildren(), dumpProfile(), and sprintf.

Referenced by dump(), and dumpChildren().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dumpProfile()

Twig_Profiler_Dumper_Blackfire::dumpProfile (   $edge,
Twig_Profiler_Profile  $profile,
$data 
)
private

Definition at line 54 of file Blackfire.php.

55 {
56 if (isset($data[$edge])) {
57 $data[$edge]['ct'] += 1;
58 $data[$edge]['wt'] += floor($profile->getDuration() * 1000000);
59 $data[$edge]['mu'] += $profile->getMemoryUsage();
60 $data[$edge]['pmu'] += $profile->getPeakMemoryUsage();
61 } else {
62 $data[$edge] = array(
63 'ct' => 1,
64 'wt' => floor($profile->getDuration() * 1000000),
65 'mu' => $profile->getMemoryUsage(),
66 'pmu' => $profile->getPeakMemoryUsage(),
67 );
68 }
69 }
getPeakMemoryUsage()
Returns the peak memory usage in bytes.
Definition: Profile.php:119
getDuration()
Returns the duration in microseconds.
Definition: Profile.php:89
getMemoryUsage()
Returns the memory usage in bytes.
Definition: Profile.php:109

References $data, Twig_Profiler_Profile\getDuration(), Twig_Profiler_Profile\getMemoryUsage(), and Twig_Profiler_Profile\getPeakMemoryUsage().

Referenced by dump(), and dumpChildren().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: