Page MenuHomePhabricator

D12655.id30485.diff
No OneTemporary

D12655.id30485.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
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)

Event Timeline