[PP-Script]Per download stage durations

Share your scripts or request scripts with specific features.
Forum rules
Please keep the forum clean - one topic per script. Questions not related to a specific script should be posted in Support forum.
Post Reply
ptpeas
Posts: 2
Joined: 03 Feb 2014, 08:30

[PP-Script]Per download stage durations

Post by ptpeas » 03 Feb 2014, 08:51

Hello,

new user just getting hands on NzbGet : first feeling is that it is quite impressive !

For the context, I've considered moving from SABnzbd after getting a higher speed internet connection (from 5MBps to 100MBps) which SABnzbd on Synology NAS couldn't take full advantage of (SABnzbd maxed out at 2,7MB/s, where NzbGet takes me at 7,5MB/s, not maxing out actual bandwith ... but fair enough !).

My goal would be to make a PP-Script that could give me informations about stages (download, check, repair, rename, unpack, post-p, ...) durations and time frames (in order to add them in an end-of-job report sent by email). I've started to look around available information (both in environnement variables & API RPC) but I can't seem to find much related (except for TotalTime in postqueue).
So far, my only option seems to rely on logfile analysis to identify the right lines and their timestamps ...

So here are the questions :
  • Does anyone confirm those information are not (yet ?) available on a per-download basis ?
  • If not, does anyone thinks of a better option than log analysis (as it is not the most reliable option imho) ?
  • Do log messages tend to vary a lot between versions ?
  • To end, a bit off-topic question : being quite unfamiliar with python, does anyone has a php pp-script template or example somewhere ?
Kudos to the devs for that great, lightweight (our NASes thank you !!) nzb client.

Peas.

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [PP-Script]Per download stage durations

Post by hugbug » 03 Feb 2014, 10:05

The info can be obtained from logs only.
There are three logs:
  1. log-file, where it is created and what kind of messages there is controlled by options in the section "Logging" of settings; You would need to read and parse the file yourself. The file can be very big (gigabytes);
  2. log screen buffer, the size of the buffer (number of stored messages) and kinds of stored messages controlled by options in the section "Logging" of settings; you can use RPC-method "log" to get this buffer. Since the size of buffer is limited it is possible that messages you are interested in were already pushed away especially if the download is not paused during post-processing;
  3. log of the post-processing job, the size of the buffer (number of stored messages) is limited by the same setting as screen log; messages of all kinds are stored here without filtering; you can use RPC-method "postqueue" to get this log. Since the size of buffer is limited it is possible that messages you are interested in were already pushed away. Because this log is only for post-processing you can't obtain download times from it.
As an example of accessing post-processing log see pp-script EMail.py (part of NZBGet distribution). It has an option to add the log to e-mail. In rare cases if I want to know how long the repair or unpack has taken I just read the log and do the math.

Text of log-messages changes rarely but it happens sometimes.

ptpeas
Posts: 2
Joined: 03 Feb 2014, 08:30

Re: [PP-Script]Per download stage durations

Post by ptpeas » 03 Feb 2014, 11:06

Many thanks for the quick answer.
I guess I'll have to deal with the log file. Size issue can probably be partly worked around using a system grep on expected key messages.
I soon as I can get a grip on this, I'll report back.

Post Reply

Who is online

Users browsing this forum: No registered users and 32 guests