-
-
Notifications
You must be signed in to change notification settings - Fork 617
Fix for the data shown in network tab. #2851
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -429,7 +429,7 @@ const buildHardwareDetailsPipeline = (monitor, dates, dateString) => { | |||||
| $cond: [ | ||||||
| { $gt: [{ $subtract: ["$$tLast", "$$tFirst"] }, 0] }, | ||||||
| { | ||||||
| $divide: [{ $subtract: ["$$last", "$$first"] }, { $divide: [{ $subtract: ["$$tLast", "$$tFirst"] }, 1000] }], | ||||||
| $divide: [{ $subtract: ["$$last", "$$first"] }, { $divide: [{ $subtract: ["$$tLast", "$$tFirst"] }, 1] }], | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2 | Confidence: High Division by 1 is a redundant operation that adds cognitive load without value. The expression
Suggested change
|
||||||
| }, | ||||||
|
Comment on lines
+432
to
433
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Patch-ready diff (revert the five denominators back to seconds) If updatedAt is a Date (milliseconds), apply this diff to fix all five changed spots: @@
- $divide: [{ $subtract: ["$$last", "$$first"] }, { $divide: [{ $subtract: ["$$tLast", "$$tFirst"] }, 1] }],
+ $divide: [{ $subtract: ["$$last", "$$first"] }, { $divide: [{ $subtract: ["$$tLast", "$$tFirst"] }, 1000] }],
@@
- $divide: [{ $subtract: ["$$last", "$$first"] }, { $divide: [{ $subtract: ["$$tLast", "$$tFirst"] }, 1] }],
+ $divide: [{ $subtract: ["$$last", "$$first"] }, { $divide: [{ $subtract: ["$$tLast", "$$tFirst"] }, 1000] }],
@@
- $divide: [{ $subtract: ["$$last", "$$first"] }, { $divide: [{ $subtract: ["$$tLast", "$$tFirst"] }, 1] }],
+ $divide: [{ $subtract: ["$$last", "$$first"] }, { $divide: [{ $subtract: ["$$tLast", "$$tFirst"] }, 1000] }],
@@
- $divide: [{ $subtract: ["$$last", "$$first"] }, { $divide: [{ $subtract: ["$$tLast", "$$tFirst"] }, 1] }],
+ $divide: [{ $subtract: ["$$last", "$$first"] }, { $divide: [{ $subtract: ["$$tLast", "$$tFirst"] }, 1000] }],
@@
- $divide: [{ $subtract: ["$$last", "$$first"] }, { $divide: [{ $subtract: ["$$tLast", "$$tFirst"] }, 1] }],
+ $divide: [{ $subtract: ["$$last", "$$first"] }, { $divide: [{ $subtract: ["$$tLast", "$$tFirst"] }, 1000] }],Also applies to: 471-472, 510-511, 565-566, 601-602 🤖 Prompt for AI Agents |
||||||
| 0, | ||||||
| ], | ||||||
|
|
@@ -468,7 +468,7 @@ const buildHardwareDetailsPipeline = (monitor, dates, dateString) => { | |||||
| $cond: [ | ||||||
| { $gt: [{ $subtract: ["$$tLast", "$$tFirst"] }, 0] }, | ||||||
| { | ||||||
| $divide: [{ $subtract: ["$$last", "$$first"] }, { $divide: [{ $subtract: ["$$tLast", "$$tFirst"] }, 1000] }], | ||||||
| $divide: [{ $subtract: ["$$last", "$$first"] }, { $divide: [{ $subtract: ["$$tLast", "$$tFirst"] }, 1] }], | ||||||
| }, | ||||||
| 0, | ||||||
| ], | ||||||
|
|
@@ -507,7 +507,7 @@ const buildHardwareDetailsPipeline = (monitor, dates, dateString) => { | |||||
| $cond: [ | ||||||
| { $gt: [{ $subtract: ["$$tLast", "$$tFirst"] }, 0] }, | ||||||
| { | ||||||
| $divide: [{ $subtract: ["$$last", "$$first"] }, { $divide: [{ $subtract: ["$$tLast", "$$tFirst"] }, 1000] }], | ||||||
| $divide: [{ $subtract: ["$$last", "$$first"] }, { $divide: [{ $subtract: ["$$tLast", "$$tFirst"] }, 1] }], | ||||||
| }, | ||||||
| 0, | ||||||
| ], | ||||||
|
|
@@ -562,7 +562,7 @@ const buildHardwareDetailsPipeline = (monitor, dates, dateString) => { | |||||
| $cond: [ | ||||||
| { $gt: [{ $subtract: ["$$tLast", "$$tFirst"] }, 0] }, | ||||||
| { | ||||||
| $divide: [{ $subtract: ["$$last", "$$first"] }, { $divide: [{ $subtract: ["$$tLast", "$$tFirst"] }, 1000] }], | ||||||
| $divide: [{ $subtract: ["$$last", "$$first"] }, { $divide: [{ $subtract: ["$$tLast", "$$tFirst"] }, 1] }], | ||||||
| }, | ||||||
| 0, | ||||||
| ], | ||||||
|
|
@@ -598,7 +598,7 @@ const buildHardwareDetailsPipeline = (monitor, dates, dateString) => { | |||||
| $cond: [ | ||||||
| { $gt: [{ $subtract: ["$$tLast", "$$tFirst"] }, 0] }, | ||||||
| { | ||||||
| $divide: [{ $subtract: ["$$last", "$$first"] }, { $divide: [{ $subtract: ["$$tLast", "$$tFirst"] }, 1000] }], | ||||||
| $divide: [{ $subtract: ["$$last", "$$first"] }, { $divide: [{ $subtract: ["$$tLast", "$$tFirst"] }, 1] }], | ||||||
| }, | ||||||
| 0, | ||||||
| ], | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Contextual Comment]
This comment refers to code near real line 428. Anchored to nearest_changed(429) line 429.
P1 | Confidence: High
The change replaces a division by 1000 with division by 1 in network metric calculations. While the PR description states the data is already in seconds, this change fundamentally alters the rate calculation from bytes-per-millisecond to bytes-per-second. However, there's a critical inconsistency: the change was applied to only 5 of 6 similar metric calculations (deltaBytesSent, deltaBytesRecv, deltaPacketsSent, deltaPacketsRecv, deltaErrIn), but deltaErrOut remains unchanged. This creates inconsistent units across related metrics, potentially causing misleading visualizations where 5 metrics use bytes/second while deltaErrOut uses bytes/millisecond (1000x larger). The frontend likely expects consistent units across all network metrics.
Code Suggestion: