You are not logged in.

#1 2010-04-08 23:42:42

encelo
Member
From: Oxford, UK
Registered: 2005-02-23
Posts: 96
Website

PacStats revamped! (Statistical charts about pacman activity)

Hi guys,
I'm pretty sure no one remembers this really old post.
I was presenting to the world my project PacStats, it was neat and cute but also the classic toy project that dies after some days.
Well, I don't know why but I'm taking a look at it again after years and I have got some nice ideas that I would be glad to implement.

logo.png

Project description wrote:

PacStats is able to analyze the log and the lib directory of the ArchLinux package manager (pacman) and generate statistical charts.
The GUI is programmed in Python with PyGTK, the internal database is based on SQLite and the charts are made with Matplotlib.

This time I'm more serious, the project has a page on Google Code (where you can get the sources, report an issue, etc.), Ohloh (for interesting coding statistics), freshmeat and is already on AUR.
Enjoy your pacman charts! wink

Last edited by encelo (2010-04-23 01:42:49)


Blog | Twitter | nCine 2D game engine
All problems in computer graphics can be solved with a matrix inversion. - James Blinn.

Offline

#2 2010-04-12 07:51:59

encelo
Member
From: Oxford, UK
Registered: 2005-02-23
Posts: 96
Website

Re: PacStats revamped! (Statistical charts about pacman activity)

Many new changes have been made these days to the sources!
First of all the home of the project now show two new screenshots: the first one is about the new database information window, while in the second you can see the preferences one.
Another change for end users is the addition of two new charts, one plots the number of transactions per day this month, while the other let you know how many packages haven't been updated in the last few months.


Blog | Twitter | nCine 2D game engine
All problems in computer graphics can be solved with a matrix inversion. - James Blinn.

Offline

#3 2010-04-19 23:00:33

encelo
Member
From: Oxford, UK
Registered: 2005-02-23
Posts: 96
Website

Re: PacStats revamped! (Statistical charts about pacman activity)

A lot of new commits have been pushed to the repository.
Having a look at the updated screenshots can reveal new charts, but for the most important enhancement you have to run the program: as a matter of fact database creation and charts plotting are way faster than before!


Blog | Twitter | nCine 2D game engine
All problems in computer graphics can be solved with a matrix inversion. - James Blinn.

Offline

#4 2010-04-22 00:10:14

encelo
Member
From: Oxford, UK
Registered: 2005-02-23
Posts: 96
Website

Re: PacStats revamped! (Statistical charts about pacman activity)

Be sure to check the last commit, the initial parsing process is now almost instantaneous!
There are also two new charts to play with, and some of you may be glad to read that the program now recognize very old (>3 years) timestamp formats.


Blog | Twitter | nCine 2D game engine
All problems in computer graphics can be solved with a matrix inversion. - James Blinn.

Offline

#5 2010-04-22 00:33:49

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: PacStats revamped! (Statistical charts about pacman activity)

"The database is out of sync. Do you want to update now?"
I get this every time - do I have to somehow save the db?

Edit: I'll better check the last commit first ...

Last edited by karol (2010-04-22 00:35:36)

Offline

#6 2010-04-22 00:38:35

encelo
Member
From: Oxford, UK
Registered: 2005-02-23
Posts: 96
Website

Re: PacStats revamped! (Statistical charts about pacman activity)

karol wrote:

"The database is out of sync. Do you want to update now?"
I get this every time - do I have to somehow save the db?

Edit: I'll better check the last commit first ...

The database is automatically saved.
Yes, I suggest you update to the last changeset because a couple of bugs related with the startup check have been corrected lately.


Blog | Twitter | nCine 2D game engine
All problems in computer graphics can be solved with a matrix inversion. - James Blinn.

Offline

#7 2010-04-22 00:41:36

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: PacStats revamped! (Statistical charts about pacman activity)

Yeah, it's fixed :-) And the initial parsing is lightning fast indeed.

Offline

#8 2010-04-22 00:46:00

encelo
Member
From: Oxford, UK
Registered: 2005-02-23
Posts: 96
Website

Re: PacStats revamped! (Statistical charts about pacman activity)

karol wrote:

Yeah, it's fixed smile

I'm glad to see that everything works correctly for you, but keep on testing it, so that a 0.1 version could be released soon. wink

karol wrote:

And the initial parsing is lightning fast indeed.

Look at the benchmarks on my system:
BEFORE

Parsing the log "/var/log/pacman.log"
Parsed 29481 lines in 34.430000 seconds
Parsing the lib "/var/lib/pacman/local"
Parsed 1030 packages in 2.110000 seconds

AFTER

Parsing the log "/var/log/pacman.log"
Parsed 29481 lines in 0.690000 seconds
Parsing the lib "/var/lib/pacman/local"
Parsed 1030 packages in 0.270000 seconds

Something, that I am ashamed of, was the cause for the big slowdown in the previous revision. big_smile

Last edited by encelo (2010-04-22 00:51:28)


Blog | Twitter | nCine 2D game engine
All problems in computer graphics can be solved with a matrix inversion. - James Blinn.

Offline

#9 2010-04-26 22:14:39

encelo
Member
From: Oxford, UK
Registered: 2005-02-23
Posts: 96
Website

Re: PacStats revamped! (Statistical charts about pacman activity)

Got some news for the project, the last revision introduces four new charts!
You can now learn the most adopted licenses, the length of package description and the update frequency for some of them.


Blog | Twitter | nCine 2D game engine
All problems in computer graphics can be solved with a matrix inversion. - James Blinn.

Offline

#10 2010-05-13 11:56:12

wido
Member
Registered: 2008-10-22
Posts: 14

Re: PacStats revamped! (Statistical charts about pacman activity)

Hello,
problem:

i accept a message "The database is empty. Do you want to build it now?", program crash:

[img]$ pacstats
"transactions" table exists already
"packages" table exists already
/usr/lib/python2.6/site-packages/matplotlib/backends/backend_gtk.py:621: DeprecationWarning: Use the new widget gtk.Tooltip
  self.tooltips = gtk.Tooltips()
Gtk-Message: (for origin information, set GTK_DEBUG): failed to retrieve property `GtkTreeView::odd-row-color' of type `GdkColor' from rc file value "((GString*) 0x1fc9d60)" of type `GString'
Parsing the log "/var/log/pacman.log"
Parsed 6418 lines in 0.080000 seconds
Traceback (most recent call last):
  File "/usr/bin/pacstats", line 38, in <module>
    app = app.Application(share_dir)
  File "/usr/lib/python2.6/site-packages/PacStats/app.py", line 48, in __init__
    self.main_win = main_win.Main_Window(self)
  File "/usr/lib/python2.6/site-packages/PacStats/main_win.py", line 95, in __init__
    self.check_update()
  File "/usr/lib/python2.6/site-packages/PacStats/main_win.py", line 129, in check_update
    self.on_update_db_activate(None)
  File "/usr/lib/python2.6/site-packages/PacStats/main_win.py", line 221, in on_update_db_activate
    self._libparser.parse()
  File "/usr/lib/python2.6/site-packages/PacStats/libparser.py", line 42, in parse
    locale.setlocale(locale.LC_ALL, 'en_US.UTF8')
  File "/usr/lib/python2.6/locale.py", line 513, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting[/img]

archlinux x86_64, testing, xorg 1.8 and french.

Offline

#11 2010-05-15 01:06:40

encelo
Member
From: Oxford, UK
Registered: 2005-02-23
Posts: 96
Website

Re: PacStats revamped! (Statistical charts about pacman activity)

wido wrote:

Hello,
problem:

i accept a message "The database is empty. Do you want to build it now?", program crash:

[...]
  File "/usr/lib/python2.6/site-packages/PacStats/libparser.py", line 42, in parse
    locale.setlocale(locale.LC_ALL, 'en_US.UTF8')
[...]

archlinux x86_64, testing, xorg 1.8 and french.

First of all, thank you for the report.
As you see the problem is caused by the fact that the application is trying to set an English locale that you don't have installed on your workstation.
But why am I forcing an English locale in the pacman library parser?

Well, actually not many users are going to run that part of the code, that is because it is triggered by very old timestamps.
They have got a format that is easier to let Python parse using the datetime module.
The application is assuming that the old versions of pacman that were writing those old packages timestamps were also all forced to use an English locale, but I'm not sure this is always the case.
Maybe pacman itself was using locale settings to write those strings, and maybe your old package timestamps have French month names and date format.

Look into /var/lib/pacman/local and try to find which packages have the %BUILDDATE% or %INSTALLDATE% fields of their desc file not containing an epoch number and report me the timestamps string.
You could also try to simply comment out line 42 in libparser.py to see if timestamps are correctly parsed with your current locale.


Blog | Twitter | nCine 2D game engine
All problems in computer graphics can be solved with a matrix inversion. - James Blinn.

Offline

#12 2010-05-15 11:57:05

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: PacStats revamped! (Statistical charts about pacman activity)

I like it! I miss one obvious feature though; a graph of transactions over the entire period my system has been running. Also, wouldn't it be more logical to use the red color for removals, and yellow for synchronizations?

Offline

#13 2010-05-15 12:56:35

encelo
Member
From: Oxford, UK
Registered: 2005-02-23
Posts: 96
Website

Re: PacStats revamped! (Statistical charts about pacman activity)

Spider.007 wrote:

I like it! I miss one obvious feature though; a graph of transactions over the entire period my system has been running.

How do you think to implement something like this? Maybe a histogram for ever year?
Because I've got more than five years of logs and plotting dozens of mothly histograms won't be very good, unless I find a way to plot a lot of data but zoom on the last period of time.

Spider.007 wrote:

Also, wouldn't it be more logical to use the red color for removals, and yellow for synchronizations?

And maybe green for installations. wink
Yeah, actually it makes sense to me.


Blog | Twitter | nCine 2D game engine
All problems in computer graphics can be solved with a matrix inversion. - James Blinn.

Offline

#14 2010-05-15 14:06:12

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: PacStats revamped! (Statistical charts about pacman activity)

encelo wrote:
Spider.007 wrote:

I like it! I miss one obvious feature though; a graph of transactions over the entire period my system has been running.

How do you think to implement something like this? Maybe a histogram for ever year?
Because I've got more than five years of logs and plotting dozens of mothly histograms won't be very good, unless I find a way to plot a lot of data but zoom on the last period of time.

I've got more than five years of history too, but I don't see what would go wrong if you would plot all of them? Zooming is already supported, so you can just zoom-out by default. Here is a quick mockup of what I think it could look like:

pacstats-mock.png

Offline

#15 2010-05-15 14:20:06

Ogion
Member
From: Germany
Registered: 2007-12-11
Posts: 367

Re: PacStats revamped! (Statistical charts about pacman activity)

Ooh nice. smile
This kind of programs (this one; also pacgraph) always brings me to re-look at what i have installed and if i need it etc..

Ogion


(my-dotfiles)
"People willing to trade their freedom for temporary security deserve neither and will lose both." - Benjamin Franklin
"Enlightenment is man's leaving his self-caused immaturity." - Immanuel Kant

Offline

#16 2010-05-15 15:07:31

encelo
Member
From: Oxford, UK
Registered: 2005-02-23
Posts: 96
Website

Re: PacStats revamped! (Statistical charts about pacman activity)

Spider.007 wrote:

I've got more than five years of history too, but I don't see what would go wrong if you would plot all of them? Zooming is already supported, so you can just zoom-out by default.

Actually what I really have got in mind for a next major version is to have a custom GUI for every chart, so that you would click on the Transactions chart and then choose the granularity (daily, monthly and so on) and the time period.

Ogion wrote:

This kind of programs (this one; also pacgraph) always brings me to re-look at what i have installed and if i need it etc..

In the future it will be more useful than now, I intend to parse also dependency data between packages. wink


Blog | Twitter | nCine 2D game engine
All problems in computer graphics can be solved with a matrix inversion. - James Blinn.

Offline

#17 2010-05-16 14:12:11

wido
Member
Registered: 2008-10-22
Posts: 14

Re: PacStats revamped! (Statistical charts about pacman activity)

I add :

/etc/profile:

# Locale
LANG=fr_FR.UTF-8 
LC_CTYPE=fr_FR.UTF-8
LC_ALL=fr_FR.UTF-8

/etc/locale.gen:

en_US.UTF-8 UTF-8 
fr_FR.UTF-8 UTF-8  
fr_FR ISO-8859-1  
fr_FR@euro ISO-8859-15

locale-gen and source /etc/profile

a program work now wink

Offline

#18 2010-05-17 03:40:17

encelo
Member
From: Oxford, UK
Registered: 2005-02-23
Posts: 96
Website

Re: PacStats revamped! (Statistical charts about pacman activity)

wido wrote:

I add :
[...]
a program work now wink

Ok, but that's a dirty hack. big_smile
Could you please email me a compressed archive of your /var/lib/pacman/local directory?
I would then try to fix the issue once and for all.


Blog | Twitter | nCine 2D game engine
All problems in computer graphics can be solved with a matrix inversion. - James Blinn.

Offline

Board footer

Powered by FluxBB