Hi Eduard,

On Fri, May 15, 2015 at 9:48 AM, Eduard Bloch <[email protected]> wrote:
> Hallo,
> * Sandro Tosi [Wed, May 13 2015, 09:56:56AM]:
>
>> it would be nice if apt-cacher-ng had a cli switch to output the statistical
>> information which currently only lives in the html output of report.html. It
>> seems like that html page is just a "template" and some information are
>> replacedby a-c-ng when it parses it, but if you want to graph those info the
>> only solution at this time is parsing the html output, which is .. well
>> suboptimal :)
>>
>> Bonus point if the cli switch will output those info in an easily parsable
>> manner, like YAML, JSON or other formats
>
> Not sure I want to provide a CLI interface (probably not).

I was just thinking of a apt-cacher-ng --stats to get the same output
on the command line (easy to script?), but if it's simple for you to
expose that as a URL that's fine as well; my aim is to avoid to parse
the webpage as we have to do now :)

> The current
> way is retrieving a special URL (see cron job script, you can also

the only cronjob I can found is the expire-caller.pl , are you
referring to this one?

> encode parameters from the webui and admin credentials into that URL.
> wget -qO- is your friend, IMHO).
>
> Apart from that, here is sample output. Are we happy?
>
> {
>    "assignedSpace": {
>       "debrep/dists/unstable/InRelease": 150471450,
>       "debrep/dists/unstable/main/binary-amd64/Packages": 36001368,
>       "debrep/dists/unstable/main/binary-amd64/Packages.diff/Index": 2260432,
>       "debrep/dists/unstable/main/binary-amd64/Packages.xz": 7198500,
>       "debrep/dists/unstable/main/binary-i386/Packages": 35943083,
>       "debrep/dists/unstable/main/binary-i386/Packages.diff/Index": 7876,
>       "debrep/dists/unstable/main/binary-i386/Packages.xz": 7197644,
>       "debrep/dists/unstable/main/i18n/Translation-en.diff/Index": 108235,
>       "debrep/dists/unstable/main/source/Sources": 36760788,
>       "debrep/dists/unstable/main/source/Sources.diff/Index": 7876,
>       "debrep/dists/unstable/main/source/Sources.gz": 9739685,
>       "debrep/dists/unstable/main/source/Sources.xz": 7814020
>    },
>    "total": 293510957
> }

I'm not sure what those info mean :( I Was expecting something on the line of:

2015-05-14 09:56 - 2015-05-15 09:56 248 (31.08%)550 (68.92%)798 0.03
MiB (16.49%)0.16 MiB (83.51%)0.19 MiB

(request hits/misses + percentage, total reqs date hits/misses +
percentage, total traffic) but without the unconventional data
aggregation (now it takes the exact moment of the web page request and
goes back 1 day - and so on - and that makes impossible to use the
info on the webpage to graph the cache usage, as the information keeps
rolling), so something like every day an entry with the previous days
information static and the only one changing is the current day, all

Cheers,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to