views:

342

answers:

3

I have an internal tool written in java. It would be useful to get a little feedback on how much it is used by colleagues. A simple solution would be to have the application display an image which it fetches from a web hit counter like application and just look at how often the image is accessed.

So what I am looking for: a stand-alone application (i.e. no Apache modules, cgi scripts, etc), which serves one or a couple of static images and and can log accesses, preferably with as little as possible of support of everything else. Searching for "hit counter" gave little relevant, "lightweight http server" was more relevant, although mostly overkill still. Any suggestions?

A: 

Just use Google Analytics, it's really easy and requires a short script on your pages.

stevedbrown
+1  A: 

You could try using Google Analytics. Most of the time, people using Google Analytics are tracking pageviews on a web page, and Google Provides some javascript that you can place on your page and it will track the visits to that page as well as browser capabilities/etc. Behind the scenes, that javascript is placing an image tag on the page in the manner you describe.

However, since your application is java and not a web app (I assume it's a standalone and not an applet), you won't be able to include Google's javascript (unless you embed a javascript interpreter...yick). Fortunately, it is possible to use Google's analytics without javascript.

The trick is that Google's scripts use the image http://www.google-analytics.com/__utm.gif and pass parameters via the query string. You can find a list of the parameters you can pass to the query string here. So all you'd have to do is figure out what the query string should be and have your client make the request to google's image (after setting up your google analytics account, of course).

Matt Bridges
asp316
A: 

Michal Kebrt's simple UNIX HTTP server does exactly what I was looking for.

hlovdal