-
-
Notifications
You must be signed in to change notification settings - Fork 6
v0.1.5: enriched JSON, refresh indicator, slower sampling, bits label #24
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 |
|---|---|---|
| @@ -1 +1 @@ | ||
| 0.1.4 | ||
| 0.1.5 |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -446,6 +446,12 @@ func dashboardContentLines(m Model, mode ViewMode) []string { | |||||||||||||
| if m.paused { | ||||||||||||||
| ifaceStr += theme.Muted().Render(" paused") | ||||||||||||||
| } | ||||||||||||||
| if m.bitsMode { | ||||||||||||||
| ifaceStr += theme.Muted().Render(" [bits]") | ||||||||||||||
| } | ||||||||||||||
| if m.refreshInterval != 100*time.Millisecond { | ||||||||||||||
| ifaceStr += theme.Muted().Render(" " + formatInterval(m.refreshInterval)) | ||||||||||||||
|
Comment on lines
+452
to
+453
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. suggestion: Avoid hard-coding the 100ms default refresh interval in the view layer Using Suggested implementation: if m.refreshInterval != defaultRefreshInterval {
ifaceStr += theme.Muted().Render(" " + formatInterval(m.refreshInterval))
}const defaultRefreshInterval = 100 * time.Millisecond
func formatInterval(d time.Duration) string {If your project already defines a canonical default refresh interval (e.g. in a config or model package), you should:
|
||||||||||||||
| } | ||||||||||||||
|
Comment on lines
+452
to
+454
Contributor
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. The default refresh interval of |
||||||||||||||
|
|
||||||||||||||
| renderKey := func(k, desc string) string { | ||||||||||||||
| return lipgloss.NewStyle().Foreground(lipgloss.Color(theme.GetAccentColor())).Bold(true).Render(k) + " " + theme.Muted().Render(desc) | ||||||||||||||
|
|
@@ -701,6 +707,13 @@ func max(a, b int) int { | |||||||||||||
| return b | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| func formatInterval(d time.Duration) string { | ||||||||||||||
| if d >= time.Second { | ||||||||||||||
| return fmt.Sprintf("every %ds", int(d.Seconds())) | ||||||||||||||
| } | ||||||||||||||
|
Comment on lines
+711
to
+713
Contributor
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. Using
Suggested change
|
||||||||||||||
| return fmt.Sprintf("every %dms", d.Milliseconds()) | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| func min(a, b int) int { | ||||||||||||||
| if a < b { | ||||||||||||||
| return a | ||||||||||||||
|
|
||||||||||||||
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.
When
bitsmode is active,unit_displayreturns a bits-based unit (e.g.,Gb/s), anddownload_humandisplays the speed in bits/sec. However,download_bps,upload_bps,peak_down_bps, andpeak_up_bpsstill contain the raw bytes/sec values (s.DownBpsands.UpBps). This creates an inconsistency in the JSON output where the raw numeric values do not match the unit specified inunit_display. Consider scaling these numeric values by 8 whenbitsis true, or renaming/adding separate fields to clarify the unit.