I have set up a squid proxy and now want to monitor the amount of data transfer that is taking place. It would be nice to get numbers per domain and also about how much of the content is coming from cache. Is there any way to do this?
Lightsquid should do the trick. http://lightsquid.sourceforge.net/ I often use it on pfSense installations where I have Squid installed, I've found sometimes it doesn't work for the first day - I'm guessing it needs time to gather stats, never actually got to the bottom of that.
Calamaris is a nice perl script that parses Squid's log and outputs daily/weekly/monthly stats in mail/html/csv (pick one) format.
If you don't need active bandwidth monitoring, you should be able to do with. You get stats such as number of requests per domain, total traffic per domain, request size distribution per hour, top 10 requesters, top 10 visited domains, traffic distribution by content type, and so on...
You also get request status data, such as
Which is exactly what you're looking for (HIT = from cache, MISS = from Web)
Have a look at http://Calamaris.Cord.de/ if you're interested. It's free, of course.
Hope that helps.