| Ruby |
StatHat::API.ez_post_count("messages sent - female to male", "info@stathat.com", 1)
|
| Python |
stathat.ez_post_count('info@stathat.com', 'messages sent - female to male', 1)
|
| Go |
stathat.PostEZCount("messages sent - female to male", "info@stathat.com", 1)
|
| JavaScript |
_StatHat.push(['_trackCount', 'STATKEY', 1]);
|
| Node.js |
stathat.trackEZCount("info@stathat.com", "messages sent - female to male", 1, function(status, json) {});
|
| HTML |
<img src="http://api.stathat.com/c?ukey=USERKEY&key=STATKEY&count=1" style="display:none;" width="1" height="1"/>
|
| iOS |
[StatHat postEZStat:@"messages sent - female to male" withCount:1.0 forUser:@"info@stathat.com" delegate:self];
|
| PHP |
stathat_ez_count('info@stathat.com', 'messages sent - female to male', 1);
|
| Java |
StatHat.ezPostCount("info@stathat.com", "messages sent - female to male", 1.0);
|
| curl |
$ curl -d "stat=messages sent - female to male&email=info@stathat.com&count=1" http://api.stathat.com/ez
|
| wget |
$ wget --post-data "stat=messages sent - female to male&email=info@stathat.com&count=1" http://api.stathat.com/ez
|
| Lisp |
(stathat-ez-count "info@stathat.com" "messages sent - female to male" 1)
|
| C# |
StatHat.Post.EzCounter("info@stathat.com", "messages sent - female to male", 1);
|
| Perl |
stathat_ez_count("info@stathat.com", "messages sent - female to male", 1);
|
| Lua |
stathat.ez_count("info@stathat.com", "messages sent - female to male", 1)
|
| Erlang |
stathat.ez_count("info@stathat.com", "messages sent - female to male", 1).
|
To create a new stat, just add a new stat name to your call to StatHat. StatHat will create a new stat for you the first time it receives the data.
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", "info@stathat.com", 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 stathat.com and create a stat, just add them in your code whenever you think of something you want to track.
Because we support everything from HTML to JavaScript to Ruby to Objective-C to Go, everyone on the team can add the stats they want.
StatHat stats come in two flavors: counter and value. A counter stat sums up counts over time, while a value stat averages values over time.
For counter stats, you send StatHat a count whenever an event happens. When StatHat display the data for a counter stat, it sums up the data over time. Each data point in the chart of a counter stat is the sum total of the counts received over the time interval.
Some example counter stats:
Button presses Messages sent Sign ups/ins/outs Git commits Cache hit HTTP 500 errors cups of tea drank page views
For value stats, you send StatHat a floating point value. StatHat displays the average over time. Each data point in the chart of a value stat is the average of the values received over the time interval.
Some example value stats:
Server load average Seconds iPhone app ran for Twitter followers Duration of database queries Number of users online Amount of free memory on a server Score players get in an iPad game How far your mouse has travelled Google ping time web request time age of user