Discrepancy between download stats in plush and api

Questions and bug reports for Beta releases should be posted here.
Forum rules
Help us help you:
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
sabbied1
Newbie
Newbie
Posts: 25
Joined: March 13th, 2011, 6:29 am

Discrepancy between download stats in plush and api

Post 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
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Discrepancy between download stats in plush and api

Post 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?
sabbied1
Newbie
Newbie
Posts: 25
Joined: March 13th, 2011, 6:29 am

Re: Discrepancy between download stats in plush and api

Post 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=???
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Discrepancy between download stats in plush and api

Post 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.
sabbied1
Newbie
Newbie
Posts: 25
Joined: March 13th, 2011, 6:29 am

Re: Discrepancy between download stats in plush and api

Post 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.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Discrepancy between download stats in plush and api

Post 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.
sabbied1
Newbie
Newbie
Posts: 25
Joined: March 13th, 2011, 6:29 am

Re: Discrepancy between download stats in plush and api

Post 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?
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Discrepancy between download stats in plush and api

Post 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.
sabbied1
Newbie
Newbie
Posts: 25
Joined: March 13th, 2011, 6:29 am

Re: Discrepancy between download stats in plush and api

Post 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.
sabbied1
Newbie
Newbie
Posts: 25
Joined: March 13th, 2011, 6:29 am

Re: Discrepancy between download stats in plush and api

Post 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.
Post Reply