<th class="ay-sort regular" data-ay-sort-index="5">Peak Memory Usage</th> <th class="ay-sort regular" data-ay-sort-index="6">Wall Time</th> <th class="ay-sort regular" data-ay-sort-index="7">CPU</th> <th class="ay-sort regular" data-ay-sort-index="8">Memory Usage</th> <th class="ay-sort regular" data-ay-sort-index="9">Peak Memory Usage</th> </tr> </thead> <tfoot> <?php foreach ($aggregated_stack as $i => $a) { $b = null; if (isset($second_aggregated_stack)) { // Both aggregated callstacks have exactly the same scheme and order of the execution. $b = $second_aggregated_stack[$i]; } $a['metrics']['ct'] = format_metrics($a['metrics']['ct'], 'ct'); ?> <tr> <td><a href="<?php echo url('function', array('request_id' => $request['id'], 'callee_id' => $a['callee_id'])); ?> "><?php echo $a['callee']; ?> </a><?php if ($a['group']) { ?> <span class="group g-<?php echo $a['group']['index']; ?> "><?php
?> <th class="ay-sort uri" rowspan="2">URI</th> <th class="ay-sort regular" rowspan="2">Request Count</th> <th class="heading" colspan="4">Average</th> </tr> <tr> <th class="ay-sort" data-ay-sort-index="3">Wall Time</th> <th class="ay-sort" data-ay-sort-index="4">CPU</th> <th class="ay-sort" data-ay-sort-index="5">Memory Usage</th> <th class="ay-sort" data-ay-sort-index="6">Peak Memory Usage</th> </tr> </thead> <tbody> <?php foreach ($data['discrete'] as $e) { $e = format_metrics($e); ?> <tr> <?php if (empty($_GET['ay']['query']['host_id'])) { ?> <td><a href="<?php echo url('uris', array('host_id' => $e['host_id'])); ?> "><?php echo htmlspecialchars($e['host']); ?> </a></td> <?php } ?>
if (!isset($_GET['xhprof']['query']['request_id'], $_GET['xhprof']['query']['callee_id'])) { throw new \Exception('Missing required parameters.'); } $request = $xhprof_data_obj->get($_GET['xhprof']['query']['request_id']); if (!$request) { \ay\redirect(\ay\REDIRECT_REFERRER, 'Request data not found.'); } $xhprof_obj = new Model($request); $aggregated_family = $xhprof_obj->getFamily($_GET['xhprof']['query']['callee_id']); if (!$aggregated_family) { throw new \Exception('Function is not in the callstack.'); } $table_row = function ($e) use($request) { $e['metrics'] = format_metrics($e['metrics']); $e['metrics']['inclusive'] = format_metrics($e['metrics']['inclusive']); $e['metrics']['exclusive'] = format_metrics($e['metrics']['exclusive']); $e['metrics']['relative'] = array(); foreach ($e['metrics']['inclusive'] as $name => $data) { $e['metrics']['relative'][$name] = format_number($request['total'][$name] == 0 ? 0 : $e['metrics']['inclusive'][$name]['raw'] * 100 / $request['total'][$name]); } ?> <tr<?php if ($e['internal']) { ?> class="internal"<?php } ?> > <td><a href="<?php echo url('function', array('request_id' => $request['id'], 'callee_id' => $e['callee_id'])); ?>