Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14055244
D12655.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
962 B
Referenced Files
None
Subscribers
None
D12655.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 9:48 AM (2 d, 21 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6712681
Default Alt Text
D12655.diff (962 B)
Attached To
Mode
D12655: Compute average costs more correctly in Multimeter
Attached
Detach File
Event Timeline
Log In to Comment