popstas / transmission-cli

Transmission PHP client for detect profit torrents and automate weburg.net downloads
http://transmission-cli.popstas.ru
MIT License
18 stars 2 forks source link

stats-get shows wrong profit for series #29

Open popstas opened 8 years ago

popstas commented 8 years ago

If we download one last series, in fact we download 0.5 GB of 5 GB full torrent, but profit count full size, not downloaded.

Lokotito commented 7 years ago

Playing with this tool have same issue, DOWNLOADED value is the same as Size in grafana.

The Downloaded = Size issue, is in line 123 from TransmissionClient.php ??

But in terminal runing: transmission-cli stats-get gives me an error:

Warning: Division by zero in phar:///usr/local/bin/transmission-cli/src/Command/StatsGet.php on line 117
PHP Warning:  Division by zero in phar:///usr/local/bin/transmission-cli/src/Command/StatsGet.php on line 117

I have some torrents that was add just from magnet2 links, and have 0 size because I didn't start this torrents yet; I think this division by zero error from StatsGet.php, line 117 is related.

popstas commented 7 years ago

@Lokotito, thank you, fixed division by zero. I am never downloading torrents by magnet links, today tried - bug not repeated for me. Maybe it affected when you execute transmission-cli stats-send just after add torrent from magnet. I send stats one per hour.

But I repeated it in test, you can download updated phar at https://github.com/popstas/transmission-cli/releases/download/v0.7.4/transmission-cli.phar

And what about downloaded = size, and TransmissionClient.php:123?

Lokotito commented 7 years ago

Well first at all, thank you very much for your effort, really apreciate your work (I use almost all 24/7 transmission-remote), your software is very useful for me.

The division by zero error shows in stats-get option, not in send. Will try to reproduce with new version. today (30 agust) Try the 0.74 version don't show any errors in terminal 👍 . Analizing more in detailed about this errors I take in count that the package transmission-remote have a dependency also called transmission-cli (currently abandoned but exist for compatibility reasons acording its git). Today (30-Agust) have a warning-error message about another instance of transmission runing in 9091 port and take in count about the existence of software with same name in my server, I changed your software name to transmission-php-cli in my /etc/local/lib and this warning also dissapears, but now I have to use transmission-php-cli stats-get comand in my terminal of course, again no error message; so maybe the error comes from daemon program.

The secong issue, I was talking about InfluxDbClient.php file (sorry maybe I was a litle sleepy yesterday):

https://github.com/popstas/transmission-cli/blob/8012da3fa97d4b82f34b7b287a12b0e3bfffd185/src/InfluxDbClient.php#L123

Yesterday night (late for me) try to change the value from line 123, as: 'downloaded' => $torrent[Torrent\Get::DOWNLOAD_EVER],

And all the stats for DOWNLOADED works very well.

I don't know if you have plans to add speed metrics for your software (downloading and uploading speeds); and also will be great to implement in UPLOADED: active-downloading (something like speed x downloading_status) , active-sedding (something like speed x seeding_status).

I'm not soft developer (at best, just a computer fan), indeed is the first time that I edit/create a PHAR file and something in php. So this implementations is out of range for me.

Best regards.