Page MenuHomePhabricator

D12655.diff
No OneTemporary

D12655.diff

diff --git a/src/applications/multimeter/controller/MultimeterSampleController.php b/src/applications/multimeter/controller/MultimeterSampleController.php
--- a/src/applications/multimeter/controller/MultimeterSampleController.php
+++ b/src/applications/multimeter/controller/MultimeterSampleController.php
@@ -56,7 +56,10 @@
$data = queryfx_all(
$conn,
- 'SELECT *, count(*) N, SUM(sampleRate * resourceCost) as totalCost
+ 'SELECT *,
+ count(*) AS N,
+ SUM(sampleRate * resourceCost) AS totalCost,
+ SUM(sampleRate * resourceCost) / SUM(sampleRate) AS averageCost
FROM %T
WHERE %Q
GROUP BY %Q
@@ -177,7 +180,7 @@
MultimeterEvent::formatResourceCost(
$viewer,
$row['eventType'],
- $row['totalCost'] / $row['N']),
+ $row['averageCost']),
MultimeterEvent::formatResourceCost(
$viewer,
$row['eventType'],

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 21, 2:49 AM (19 h, 29 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6712681
Default Alt Text
D12655.diff (962 B)

Event Timeline