Repository navigation
Added network monitor support for Linux platform #2126
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
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 |
|---|---|---|
|
|
@@ -107,6 +107,8 @@ const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = { | |
| #endif | ||
| [GPU_TIME] = { .name = "GPU_TIME", .title = "GPU_TIME ", .description = "Total GPU time", .flags = PROCESS_FLAG_LINUX_GPU, .defaultSortDesc = true, }, | ||
| [GPU_PERCENT] = { .name = "GPU_PERCENT", .title = " GPU% ", .description = "Percentage of the GPU time the process used in the last sampling", .flags = PROCESS_FLAG_LINUX_GPU, .defaultSortDesc = true, }, | ||
| [TCP_UPLOAD_RATE] = { .name = "TCP_UPLOAD_RATE", .title = " TCP UPLOAD ", .description = "Upload rate of the TCP in seconds", .flags = PROCESS_FLAG_LINUX_NET_MONITOR, .defaultSortDesc = true }, | ||
| [TCP_DOWNLOAD_RATE] = { .name = "TCP_DOWNLOAD_RATE", .title = " TCP DOWNLOAD ", .description = "Download rate of the TCP in seconds", .flags = PROCESS_FLAG_LINUX_NET_MONITOR, .defaultSortDesc = true }, | ||
|
Comment on lines
+110
to
+111
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. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Correct the field descriptions. The descriptions say "Upload rate of the TCP in seconds". These are rates in bytes per second. Use "TCP upload rate in bytes per second" and "TCP download rate in bytes per second". |
||
| }; | ||
|
|
||
| Process* LinuxProcess_new(const Machine* host) { | ||
|
|
@@ -355,6 +357,12 @@ static void LinuxProcess_rowWriteField(const Row* super, RichString* str, Proces | |
| xSnprintf(buffer, n, "N/A "); | ||
| } | ||
| break; | ||
| case TCP_DOWNLOAD_RATE: | ||
| Row_printRate(str, lp->tcp_rate.download, coloring); | ||
| return; | ||
| case TCP_UPLOAD_RATE: | ||
| Row_printRate(str, lp->tcp_rate.upload, coloring); | ||
| return; | ||
| default: | ||
| Process_writeField(this, str, field); | ||
| return; | ||
|
|
@@ -451,6 +459,10 @@ static int LinuxProcess_compareByKey(const Process* v1, const Process* v2, Proce | |
| return SPACESHIP_NUMBER(p1->gpu_time, p2->gpu_time); | ||
| case ISCONTAINER: | ||
| return SPACESHIP_NUMBER(v1->isRunningInContainer, v2->isRunningInContainer); | ||
| case TCP_DOWNLOAD_RATE: | ||
| return compareRealNumbers(p1->tcp_rate.download, p2->tcp_rate.download); | ||
| case TCP_UPLOAD_RATE: | ||
| return compareRealNumbers(p1->tcp_rate.upload, p2->tcp_rate.upload); | ||
| default: | ||
| return Process_compareByKey_Base(v1, v2, key); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,7 @@ in the source distribution for its full text. | |
| #include "Hashtable.h" | ||
| #include "Machine.h" | ||
| #include "Macros.h" | ||
| #include "NetSpeed.h" | ||
| #include "Object.h" | ||
| #include "Process.h" | ||
| #include "Row.h" | ||
|
|
@@ -1779,6 +1780,10 @@ static bool LinuxProcessTable_recurseProcTree(LinuxProcessTable* this, openat_ar | |
| } | ||
| } | ||
|
|
||
| if (ss->flags & PROCESS_FLAG_LINUX_NET_MONITOR) { | ||
| NetSpeed_dirty(lp); | ||
| } | ||
|
|
||
|
Comment on lines
+1783
to
+1786
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. 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win This block calls a function that does nothing.
|
||
| /* | ||
| * Final section after all data has been gathered | ||
| */ | ||
|
|
||
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.
📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
Remove the duplicate include, and restore
ProcessTable.hif it was removed.NetSpeed.his included twice, at Line 28 and at Line 35 aslinux/NetSpeed.h. Keep onlylinux/NetSpeed.h. The change summary says that theProcessTable.hinclude was removed. Confirm that this file still compiles without it through an indirect include.