@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Compute average costs more correctly in Multimeter

Summary: Ref T6930. We were dividing total cost by number of samples, but should more accurately divide it by the sum of the sample rates. This produces a more meaningful number.

Test Plan: Saw a more meaningful number in the UI.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T6930

Differential Revision: https://secure.phabricator.com/D12655

+5 -2
+5 -2
src/applications/multimeter/controller/MultimeterSampleController.php
··· 56 56 57 57 $data = queryfx_all( 58 58 $conn, 59 - 'SELECT *, count(*) N, SUM(sampleRate * resourceCost) as totalCost 59 + 'SELECT *, 60 + count(*) AS N, 61 + SUM(sampleRate * resourceCost) AS totalCost, 62 + SUM(sampleRate * resourceCost) / SUM(sampleRate) AS averageCost 60 63 FROM %T 61 64 WHERE %Q 62 65 GROUP BY %Q ··· 177 180 MultimeterEvent::formatResourceCost( 178 181 $viewer, 179 182 $row['eventType'], 180 - $row['totalCost'] / $row['N']), 183 + $row['averageCost']), 181 184 MultimeterEvent::formatResourceCost( 182 185 $viewer, 183 186 $row['eventType'],