Skip to content
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

Implement LogFormat variable for data transfer average speed #535

Closed
graxlop opened this issue Jul 13, 2017 · 7 comments
Closed

Implement LogFormat variable for data transfer average speed #535

graxlop opened this issue Jul 13, 2017 · 7 comments
Assignees
Milestone

Comments

@graxlop
Copy link

graxlop commented Jul 13, 2017

Hello,

I would like to request an additional variable for mod_log that would show the average transfer speed.

Maybe a format like KB/s, MB/s, etc.

Thanks

@Castaglia
Copy link
Member

Average over what unit of time? For the overall transfer? If for the entire transfer, that can easily be computed, by a log post-processor, from the total number of bytes (%b) and the transfer time (%T). I'm not sure what value would really be added in having ProFTPD do this...

@graxlop
Copy link
Author

graxlop commented Jul 14, 2017

Yes, for the entire transfer. I find it useful for debugging purposes and it seems like most other FTP server software out there supports this functionality, so I'm sure others would appreciate it as well.

@Castaglia
Copy link
Member

What other FTP servers have you seen do this, and how? I admit I don't often see just what other features other FTP servers have...

@graxlop
Copy link
Author

graxlop commented Jul 14, 2017

Pure-FTPd and vsftpd both have this functionality in their logs by default. A quick look at the vsftpd source code shows that they do it like you've described above, taking the transfer size and transfer time.

Here's an example of what vsftpd default transfer log looks like:

Fri Jul 14 06:26:14 2017 [pid 30373] [Username] OK DOWNLOAD: Client "5.5.5.5", "/Folder/Test.file", 537563631 bytes, 6118.22Kbyte/sec

@Castaglia Castaglia self-assigned this Feb 18, 2023
@Castaglia Castaglia added this to the 1.3.9 milestone Feb 18, 2023
@Castaglia
Copy link
Member

Castaglia commented Feb 18, 2023

Seems like a reasonable request. This will not be added to the fixed xferlog(5) format, but I think we can log a message (at INFO level) on completion of a file transfer, and supply a LogFormat variable for it as well for ExtendedLog cases.

This will be (roughly) equivalent to "%{file-size}/%{transfer-millisecs}", adjusted to use units of KB/s rather than B/ms.

@Castaglia
Copy link
Member

Castaglia commented Feb 19, 2023

For my reference, pure-ftpd uses "KB/sec" (see here), whereas vsftpd uses "Kbyte/sec" (see here). I think ProFTPD uses "KB" elsewhere, so I'll use "KB/s".

@Castaglia Castaglia changed the title Support logging transfer speed Implement LogFormat variable for data transfer average speed Feb 19, 2023
Castaglia added a commit that referenced this issue Feb 19, 2023
…r logging the average transfer speed for a given data transfer.
Castaglia added a commit that referenced this issue Feb 19, 2023
…r logging the average transfer speed for a given data transfer.
Castaglia added a commit that referenced this issue Feb 19, 2023
Issue #535: Implement a `LogFormat` variable, `%{transfer-speed}`, fo…
@Castaglia
Copy link
Member

Implemented in master now. Thanks!

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

No branches or pull requests

2 participants