Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
butschster committed Jun 9, 2024
1 parent ef98a3f commit 8caa026
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public function __invoke(FindFlameChartByUuid $query): array

$waterfall = [];
$eventCache = [];
$metric = 'cpu';
// TODO: send metric from the frontend side
$metric = 'wt';

foreach ($edges as $edge) {
$duration = $edge->getCost()->{$metric} ?? 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ public function __invoke(FindTopFunctionsByUuid $query): array
foreach ($functions as $function => $m) {
foreach ($metrics as $metric) {
$functions[$function]['p_' . $metric] = \round(
$functions[$function][$metric] / $overallTotals[$metric] * 100,
$functions[$function][$metric] > 0 ? $functions[$function][$metric] / $overallTotals[$metric] * 100 : 0,
3,
);
$functions[$function]['p_excl_' . $metric] = \round(
$functions[$function]['excl_' . $metric] / $overallTotals[$metric] * 100,
$functions[$function]['excl_' . $metric] > 0 ? $functions[$function]['excl_' . $metric] / $overallTotals[$metric] * 100 : 0,
3,
);
}
Expand Down

0 comments on commit 8caa026

Please sign in to comment.