You are not logged in.
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.
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!
Last edited by encelo (2010-04-23 01:42:49)
Offline
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.
Offline
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!
Offline
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.
Offline
"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
"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.
Offline
Yeah, it's fixed :-) And the initial parsing is lightning fast indeed.
Offline
Yeah, it's fixed
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.
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.
Last edited by encelo (2010-04-22 00:51:28)
Offline
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.
Offline
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
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.
Offline
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
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.
Also, wouldn't it be more logical to use the red color for removals, and yellow for synchronizations?
And maybe green for installations.
Yeah, actually it makes sense to me.
Offline
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:
Offline
Ooh nice.
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
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.
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.
Offline
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
Offline
I add :
[...]
a program work now
Ok, but that's a dirty hack.
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.
Offline