bluewave-labs / bluewave-labs/Checkmate

Network calculations are off by a factor of 10

Open
#2,814 15 comments 0 reactions 2 assignees Claimed by @ajhollid View on GitHub
Dominant language
TypeScript
Stars
10.8k
Forks
1.2k
Avg merge
1d 4h
Merged PRs (30d)
74

Description

**Describe the bug**
All the network calculations are showing as 10Xs the actual value (showing 50GB/s instead of 5 GB/s...I only have 10Gb interfaces so 50 is impossible).

It seems that the updatedAt timestamp is not in the expected format so dividing by 1000 makes it too large. Dividing by 100 for all the network calculations fixes the issue:

https://github.com/bluewave-labs/Checkmate/blob/9bd2e336a61cbb427e5e4c715d06c57f3ee3bb40/server/src/db/mongo/modules/monitorModuleQueries.js#L432

Changing all of these:
`$divide: [{ $subtract: ["$$last", "$$first"] }, { $divide: [{ $subtract: ["$$tLast", "$$tFirst"] }, 1000] }],`

To:
`$divide: [{ $subtract: ["$$last", "$$first"] }, { $divide: [{ $subtract: ["$$tLast", "$$tFirst"] }, 100] }],`

**To Reproduce**
Steps to reproduce the behavior:
1. Go to Infrastructure
2. Select a server
3. Click on Network tab
4. See miscalculated network bandwidth

**Expected behavior**
To show network bandwidth accurately

**Desktop (please complete the following information):**
- Browser : All
- Version 3.1-beta

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.