ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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

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.

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

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
27 file-format: BlackfireProbe
28 cost-dimensions: wt mu pmu
29 request-start: {$start}
30 
31 
32 EOF;
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  }
dumpProfile($edge, Twig_Profiler_Profile $profile, &$data)
Definition: Blackfire.php:54
$start
Definition: bench.php:8
dumpChildren($parent, Twig_Profiler_Profile $profile, &$data)
Definition: Blackfire.php:41
$values
$data
Definition: bench.php:6
const EOF
How fgetc() reports an End Of File.
Definition: JSMin_lib.php:92
+ 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.

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

Referenced by dump().

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  }
dumpProfile($edge, Twig_Profiler_Profile $profile, &$data)
Definition: Blackfire.php:54
dumpChildren($parent, Twig_Profiler_Profile $profile, &$data)
Definition: Blackfire.php:41
$data
Definition: bench.php:6
+ 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.

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

Referenced by dump(), and dumpChildren().

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
getMemoryUsage()
Returns the memory usage in bytes.
Definition: Profile.php:109
getDuration()
Returns the duration in microseconds.
Definition: Profile.php:89
$data
Definition: bench.php:6
+ 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: