Skip to content

Add a live transfer speed graph to the progress window - #3876

Open
KAMI911 wants to merge 5 commits into
linuxmint:masterfrom
KAMI911:speed-graph
Open

KAMI911 wants to merge 5 commits into
linuxmint:masterfrom
KAMI911:speed-graph

Conversation

@KAMI911

@KAMI911 KAMI911 commented Nov 8, 2026

Copy link
Copy Markdown

Summary

Adds a collapsible live transfer speed graph to the file operation progress window, makes the progress bar move smoothly while a big file is copied, and shows how much was copied while an operation is paused.

  • Graph: moving average over about a second, the whole history (up to an hour) stretched over the width, rounded y-axis, dashed peak and average lines, and the current speed next to the buttons. A pause freezes the graph instead of drawing zeros.
  • Why it needs the destination file size: with copy_file_range, GIO reports progress only every GiB or so, which is too coarse. The size of the file being written (the destination, or GLib's .goutputstream-* temp file when overwriting) is read by a small worker thread pool, with lstat, so a stalled network/FUSE mount can never block the main loop and symlinks are not followed. It is per job, so several running operations do not disturb each other.
  • Progress bar: shows the larger of GIO's reported progress and the live file size (capped at 100%).
  • Paused: the details line reads Paused (X of Y).
  • Setting: new copy-speed-graph-interval (default 0.2 s, range 0.05 to 5 s).

The speed maths lives in a GTK-free module (nemo-speed-graph-math) with unit tests.

Notes

  • Overwrite finds the temp file among the process's own open descriptors (/proc/self/fd) and claims it per job. If it can't be found, the operation's own counter is used.
  • New translatable strings: Paused (%S of %S), peak: %s/s, avg: %s/s, now: ..., Transfer speed.

Testing

  • New unit tests: Speed graph math test (13 cases) and Progress info live bytes test (live size, symlinks, directories, temp-file following, progress bar), clean under ASan/UBSan.
  • Built as a Debian package for 6.8 and tried by hand with multi-GiB files: copy, several parallel copies, pause and resume.
  • The other tests in test/ need a display and a GSettings schema; they fail in a plain container with or without this change.
  • Not tried by hand: moves, overwrite on network mounts, and the 6.6/5.8/5.6 branches (no backports included).

🤖 Generated with Claude Code

KAMI911 and others added 5 commits November 8, 2026 11:40
Pure, GTK-free helpers for the upcoming transfer speed graph: the rounded
y-axis ceiling, the moving average, bucketing of a long history into
pixel columns, the overall average and the byte accounting of one
operation (its own counter refined by the size of the file being written;
a pause only moves the baseline, so a chunk finishing during a pause does
not show up as one huge sample on resume).

Unit tests cover all of it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
GIO reports progress only every GiB or so with copy_file_range, which is
too coarse to follow a transfer. Keep the byte count of the operation in
the progress info, and let the copy code tell it which destination file is
being written. The size of that file is read by a small worker thread pool,
so a stalled network or FUSE mount can never block the main loop, and with
lstat, so a symlink is not followed.

For a plain copy or move that is the destination itself. When overwriting,
GLib writes a .goutputstream-* temp file next to the target first; it is
found among the process's own open descriptors and claimed per job, so two
jobs in one directory never share one.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A collapsible graph under the "N of M" line of each file operation shows
the transfer speed: a moving average over about a second, the whole history
(up to an hour) stretched over the width, a rounded y-axis, dashed peak and
average lines, and the current speed next to the buttons. A pause freezes
the graph and the average instead of drawing zeros.

The sampling interval comes from the new copy-speed-graph-interval setting
(default 0.2 s, 0.05 to 5 s).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Between two reports from GIO, show the larger of the reported progress and
the size of the file being written (never above 100%), so the bar moves
smoothly while a big file is copied.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The details line now reads "Paused (X of Y)" instead of just "Paused".

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@KAMI911

KAMI911 commented Nov 8, 2026

Copy link
Copy Markdown
Author
transfer_speed_05

@KAMI911

KAMI911 commented Nov 8, 2026

Copy link
Copy Markdown
Author
transfer_speed_03

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant