GNU Thales is an IRC to Database Gateway. It connects to your IRC network as a service, and converts messages it receives to SQL queries to update the database. It collects data about users, channels and server. It doesn't build stats itself, however, it gives you the database, it's up to you how you use it.
Latest Stable Release
1.0 and it can be downloaded here