StatHat API: Making it Simple to See Your Apps by the Numbers

So just how is your App doing? Got calls on your API? How many? StatHat API makes it possible to answer these types of questions statistically and to chart the data to pick out trends and patterns. Seeing is comprehending.

StatHat has an EZ API and a Classic API. With the EZ API, you don't have to go to the StatHat website, creating stats on the fly. On the other hand, StatHat says,

"The Classic API requires you to create your stats with the web interface. Its use of signed keys is more tamper-resistant than the EZ API, but it is less convenient to add new stats while you are coding. It is the only recommended API for situations where the stat posting code will be viewable by anyone (client side JavaScript and HTML, for example)."

StatHat has a commitment to providing its tools flexibly, with libraries that enable using the API in many different coding languages.

In addition to the chart example above, you could view that same data singularly side by side, as 3 different charts. Stathat also has histograms. You can also look at one stat over a variety of time intervals. In this case, you might have one graph showing changes in value over an hour, another graph with changes over 12 hours, another over a day, a week, a month and a year, with a separate graph for each one. You can also embed charts on your site, either for public view or internal use.

Behind the great visuals, perhaps the most important feature is simplicity through and through. Take the discussion on how to invent or track a new stat:

"For example, say you're working on the search Function for your web app. While in the middle of it, you decide it would be nice to know how long the search queries take. Just add a line to tell StatHat the query time:

start := time.Now()
results := search.Find(query)
elapsed := time.Since(start) / time.Millisecond
stathat.PostEZValue("search query time", "", elapsed)

Once you run the code, StatHat will create the "search query time" stat. There's no need to interrupt your coding to go to and create a stat, just add them in your code whenever you think of something you want to track."

Integration is also a snap. Tracking a stat can take as little as one line of code.

Be sure to read the next API article: Google Compute API - Affordable Computing at Google Scale