Page 1 of 1

Discrepancy between download stats in plush and api

Posted: March 13th, 2011, 6:44 am
by sabbied1
Hi,

For some reason there's a discrepancy between the downloads stats in plush and the api.
It's almost like the download stats in plush reset to an old number after each shutdown and startup of the pc.

Maybe it has got something to do with upgrading from 0.5.6 to 0.6.0 Beta 3, but I'm not sure.
I do know that at first it didn't have the stats from 0.5.6 included after upgrading. The next time
SABnzbd started, those stats were there all of a sudden, and (if I'm not mistaken) the api key
reverted back to what it was in 0.5.6.

Stats in plush:

1.1 G Today    11.5 G This week    32.8 G This month    117.8 G Total

Stats in api:

25.0 G This week    46.4 G This month    131.3 G Total

Re: Discrepancy between download stats in plush and api

Posted: March 13th, 2011, 7:47 am
by shypike
0.6.0 uses a new file for storing data.
If it's not present, the data currently in the history is used.
This is a one time event to set the counters.
Further progress is independent from the history database.

0.6.0 does not require a new apikey and will take over what's in the existing INI file.

Is the discrepancy between API and Plush persistent?
Which API call are you using?

Re: Discrepancy between download stats in plush and api

Posted: March 13th, 2011, 8:28 am
by sabbied1
I've restarted SABnzbd a couple of times now, and the pc itself as well, but no luck so far.
The discrepancy stays the same. It could be that it reverts back tomorrow, but I'll have to
wait and see for that to happen.

I do remember I uninstalled 0.5.6 first before installing 0.6.0 Beta3 and I only checked the
"Keep settings" option. Could this be the problem? That that uninstall deleted something it shouldn't have?

I use this API-call:

api?mode=history&start=START&limit=LIMIT&output=xml&apikey=???

Re: Discrepancy between download stats in plush and api

Posted: March 14th, 2011, 1:14 pm
by shypike
Silly oversight.
The API still returns the totals as the sum of what is in the history database, just like 0.5.6 did.
0.6.0 has independent counters and these are used by the UI, so the API should show the same.
Will be fixed in the next Beta/RC.

Re: Discrepancy between download stats in plush and api

Posted: March 15th, 2011, 8:53 am
by sabbied1
Okay, that's good to hear.

But I'm not sure if that will fix my problem. Because this time I left the pc on at night to download, and This week went from 4.0 G to 10.0 G (Downloaded 4.0 G on monday and 6.0 G today). I shutdown the pc and after it got turned on again, this week was back at 4.0 G and today at 0.0 G.

What you're saying, is that the UI and API show inconsistent numbers (which they do for me), but the numbers that the UI show aren't correct either. I know for sure that I downloaded about 10 G this week, but the UI just doesn't show it. I can post a screen if you want.

Re: Discrepancy between download stats in plush and api

Posted: March 15th, 2011, 11:04 am
by shypike
Do you terminate SABnzbd while it's still downloading?
It may not have time to write everything to disk, especially when a
full article cache needs to be dumped to disk.
The next Beta it will save the counters more frequently to disk.

Re: Discrepancy between download stats in plush and api

Posted: March 15th, 2011, 11:48 am
by sabbied1
Today I shutdown the pc (and thus also SABnzbd) about 1.5 hours after it finished downloading.
Where are the cache and counters saved to exactly? Because in the config it always says "Cached 0 articles (0 B)".
And might the log file shed some light on the situation maybe?

Re: Discrepancy between download stats in plush and api

Posted: March 15th, 2011, 1:03 pm
by shypike
Cached 0 bytes is OK when paused or when the queue is empty.
The counters are in the admin folder as totals9.sab.
It's in a binary Python format, so it won't be much use.

Re: Discrepancy between download stats in plush and api

Posted: March 15th, 2011, 1:32 pm
by sabbied1
Okay, then I'll just hope for the best when the new Beta/RC comes out.
Thanks for your help though. And if it comes down to it, I might try a total reinstall.

Re: Discrepancy between download stats in plush and api

Posted: March 19th, 2011, 5:59 am
by sabbied1
After reading another post about weird download stats, I found out that deleting totals9.sab seems to do the trick to fix the counters.
This has to be done about every day though for it to work.