Giter VIP home page Giter VIP logo

Comments (4)

Xfennec avatar Xfennec commented on June 2, 2024 2

progress does not have any specific code path for specific commands, it use the same approach for each process: list opened files and report status on the "biggest" one. Looking at your message, smbd seems threaded and serves multiple files from the same process, and that's no what progress expect (it's more suited to client commands than server multi-threaded daemons)

Also, being able to serve the same file to multiple clients, it's possible that smbd "rewinds" the file after each read. That would explain why progress always shows zero.

I don't see any easy fix for that situation, but I can give a little hope: I want to write a v2 of the tool with a modular approach, so we can write specific code for specific commands, and it looks that Samba would be one of those :)

from progress.

NightMachinery avatar NightMachinery commented on June 2, 2024

It also always says everything is at zero, even though the other machine reports slow (~300 KB/s) but steady progress and the completion at 3%.

PS: Is there any other way to measure the transfer speeds of smbd from the mac? iPad doesn't show them, so I need to figure them out from the server (i.e., the mac).

from progress.

NightMachinery avatar NightMachinery commented on June 2, 2024

@Xfennec Can you add a --report-biggest-n=<number> so that we can ask it to report the biggest N files instead of just one?

To show the speed, we can simply calculate it based on the difference in the filesizes since the last examinations in monitor mode. I.e., we see that a file was at 10MB previously, now after 5 seconds it's at 50MB, so the speed is roughly 40/5=8 MB/s. This, too, can be an option --estimate-speed.

You can even add a --discount-zeroes that calculates the size of the files smartly by skipping the zeroes at the end of the file (used by commands that pre-allocate). I have a rust script to calculate the trailing zeroes, and I imagine it shouldn't be hard in other languages as well:

#!/usr/bin/env scriptisto

// scriptisto-begin
// script_src: src/main.rs
// build_cmd: cargo build --release
// target_bin: ./target/release/script
// files:
//  - path: Cargo.toml
//    content: |
//     package = { name = "script", version = "0.1.0", edition = "2018"}
//     [dependencies]
// scriptisto-end

// https://users.rust-lang.org/t/count-trailing-zero-bytes-of-a-binary-file/42503/4

use std::env;
use std::fs;

fn main() {
    let filename = env::args().nth(1).unwrap();
    let buffer = fs::read(filename).unwrap();
    let count = buffer.iter().rev().take_while(|b| **b == 0).count();
    println!("{}", count);
}

With all these features, progress should support 99% of use cases without any special-purpose code.

from progress.

Xfennec avatar Xfennec commented on June 2, 2024

--report-biggest-n=<number> requires quite some changes, but hey, PRs are welcome ;)

--estimate-speed is the default behavior of progress, no need for a new flag (see my original message for your current issue with smbd)

--discount-zeroes is not very Unix :) (see sparse files)

from progress.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.