slskd / slskd

A modern client-server application for the Soulseek file sharing network.
GNU Affero General Public License v3.0
976 stars 60 forks source link

uploadCount stat shows incorrect value #1162

Open o-laptiy opened 3 months ago

o-laptiy commented 3 months ago

I have noticed that in the info section the uploadCount stat always shows values between 100 and 200. Whenever it gets to 200 it resets back to 100. Happens on 0.21.0.0 and previous versions as well. I'm running the arm-v7 version.

jpdillingham commented 3 months ago

That value is sent from the server, and I don't think anyone really knows for sure what it represents. The documentation from the nicotine+ repo says:

Number of uploaded files. The value changes when sending a SendUploadSpeed server message, and is likely used by the server to calculate the average speed.

slskd sends the average speed of each finished upload to the server upon completion, so we can expect the UploadCount number sent back to change frequently.

@mathiascode would appreciate your thoughts here

mathiascode commented 3 months ago

@mathiascode would appreciate your thoughts here

All I know is that the attribute was called downloadnum in the past, likely when the SendDownloadSpeed message was still used (later replaced with SendUploadSpeed). I don't think the attribute has ever been used by the client itself, and it's not particularly useful either, since it rolls over (as observed above).

Looking closer at old PySoulSeek code from 2002, I think the uint64 value type is wrong as well. Originally there were two uint32 attributes (downloadnum and unknown), but someone combined them at one point. Likely because the unknown attribute always has a value of zero, which makes two uint32s indistinguishable from a uint64.