Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
C#
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.nuget
StatsMix
packages
.gitignore
README.md
StatsMix.sln

README.md

StatsMix

This Nuget offers easy access to the StatsMix API. See www.statsmix.com/developers/documentation for more information.

What is StatsMix?

StatsMix makes it easy to track, chart, and share application and business metrics. Use StatsMix to:

  • Log every time a particular event happens (such as a user creating a new blog post)
  • View a real-time chart of these application events in StatsMix's web UI
  • Share the charts with users inside and outside your organization
  • Create and share custom dashboards that aggregate multiple metrics together

To get started, you'll need an API key for StatsMix. You can get a free developer account here: http://www.statsmix.com/try?plan=developer

Full documentation is at http://www.statsmix.com/developers/csharp_nuget

Download and Install

Our Nuget can be found in the Nuget Gallery here.

Usage

Initialize

Create a new StatsMix Client

using StatsMix;
...
Client smClient = new Client("YOUR_API_KEY");

Track

The track method sends a request to the track API, and returns the response as a string. The following snippets were taken from this example file.

Basic Tracking. Adds a new stat with default value of 1 to the metric.

smClient.track("Metric Name");

Track with a value other than one

smClient.track("Metric Name", 5.2);

Track with additional properties

var properties = new Dictionary<string, string>();
properties.Add("value", "5.1"); //If you do not include value, it will default to 1
properties.Add("ref_id", "Test01");
properties.Add("generated_at", DateTime.Now.ToString());
smClient.track("metric_name", properties);

Track with meta data

var meta = new Dictionary<string, string>();
meta.Add("food", "icecream");
meta.Add("calories", "500");
smClient.track("metric_name", properties, meta);
Something went wrong with that request. Please try again.