Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13973919
D12655.id30485.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.id30485.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
Oct 19 2024, 3:16 AM (4 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6712681
Default Alt Text
D12655.id30485.diff (962 B)
Attached To
Mode
D12655: Compute average costs more correctly in Multimeter
Attached
Detach File
Event Timeline
Log In to Comment