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

DownloadProgress event always sends zeroes in copiedFromOrigin and copiedFromElsewhere fields #9172

Closed
mackinleysmith opened this issue Oct 12, 2023 · 1 comment
Labels
bug A problem with current functionality, as opposed to missing functionality (enhancement) needs-triage New issues needed to be validated

Comments

@mackinleysmith
Copy link

Hey there, quick followup after syncthing/docs#830. My team has noticed that the copiedFromOrigin and copiedFromElsewhere fields always seem to be 0 when DownloadProgress events fire. This appears to have been noted back in 2019 here: #5867 (comment) but no response was given back then.

Perhaps there is a better way to do what I'm after. I would really like to measure the exchange of data between peers in the network. Maybe this information is available somewhere in the database?

@mackinleysmith mackinleysmith added bug A problem with current functionality, as opposed to missing functionality (enhancement) needs-triage New issues needed to be validated labels Oct 12, 2023
@calmh
Copy link
Member

calmh commented Oct 12, 2023

You probably want to use the new metrics endpoint, which will give you want you want in a reliable manner. The download progress event is not that, for reasons discussed in the previous issues. That said, it works as designed for me:

{
    "id": 75,
    "type": "DownloadProgress",
    "time": "2023-10-12T18:22:28.962668+02:00",
    "data": {
        "default": {
            "s2": {
                "bytesDone": 56161635,
                "bytesTotal": 65980102,
                "copiedFromElsewhere": 388,
                "copiedFromOrigin": 0,
                "copiedFromOriginShifted": 0,
                "pulled": 41,
                "pulling": 75,
                "reused": 0,
                "total": 504
            }
        }
    }
}

I think you're just not getting data for the expected reason -- files that are mostly "copied from origin" or "copied from elsewhere" are handled very quickly since they are just local I/O and less download, hence you are unlikely to see download events for them.

@calmh calmh closed this as completed Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A problem with current functionality, as opposed to missing functionality (enhancement) needs-triage New issues needed to be validated
Projects
None yet
Development

No branches or pull requests

2 participants