<commit_before># BosunReporter.NET

A thread-safe C# .NET client for reporting metrics to [Bosun (Time Series Alerting Framework)](http://bosun.org). This library is more than a simple wrapper around the JSON API. It is designed to encourage best-practices while making it easy to create counters and gauges, including multi-aggregate gauges. It automatically reports metrics on an interval and handles temporary API or network outages using a re-try queue.

## Usage

* [MetricsCollector](#metricscollector)
* [Metric Types](#metric-types)
* [Counters](#counters)
* [Tags](#tags)
* [Snapshot Gauges](#snapshot-gauges)
* [Event Gauges](#event-gauges)
* [Aggregate Gauges](#aggregate-gauges)
* [Sampling Gauges](#sampling-gauges)
* [Metric Groups](#metric-groups)

### MetricsCollector

First, create a `MetricsCollector` object. This is the top-level container which will hold all of your metrics and handle sending them to the Bosun API. Therefore, you'll probably only want to instantiate one, and make it a global singleton.
 
 ```csharp
var collector = new MetricsCollector(new BosunOptions()
{
	MetricsNamePrefix = "app_name.",
	BosunUrl = "http://bosun.mydomain.com:8070",
	PropertyToTagName = NameTransformers.CamelToLowerSnakeCase,
	DefaultTags = new Dictionary<string, string> <commit_msg>Add links to AppVeyor and NuGet.<commit_after># BosunReporter.NET

A thread-safe C# .NET client for reporting metrics to [Bosun (Time Series Alerting Framework)](http://bosun.org). This library is more than a simple wrapper around the JSON API. It is designed to encourage best-practices while making it easy to create counters and gauges, including multi-aggregate gauges. It automatically reports metrics on an interval and handles temporary API or network outages using a re-try queue.

[![Build status](https://ci.appveyor.com/api/projects/status/yt8nl66ha598jbr7/branch/master?svg=true)](https://ci.appveyor.com/project/bretcope/bosunreporter-net/branch/master)

Available on [nuget.org](https://www.nuget.org/packages/BosunReporter/)

## Usage

* [MetricsCollector](#metricscollector)
* [Metric Types](#metric-types)
* [Counters](#counters)
* [Tags](#tags)
* [Snapshot Gauges](#snapshot-gauges)
* [Event Gauges](#event-gauges)
* [Aggregate Gauges](#aggregate-gauges)
* [Sampling Gauges](#sampling-gauges)
* [Metric Groups](#metric-groups)

### MetricsCollector

First, create a `MetricsCollector` object. This is the top-level container which will hold all of your metrics and handle sending them to the Bosun API. Therefore, you'll probably only want to instantiate one, and make it a global singleton.
 
 ```csharp
var collector = new MetricsCollector(new BosunOptions()
{
	MetricsNamePrefix = "app_name.",
	BosunUrl = "http://bosun.mydomain.com:8070",
	PropertyToTagName = NameTransformers.CamelToLowerSnakeCase,
	DefaultTags = new Dictionary<string, string> 
{'fraction_non_alphanumeric': 0.10781577110956037, 'fraction_numerical': 0.0052337752965806, 'mean_word_length': 5.667441860465116, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 3, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1901204', 'n_tokens_mistral': 911, 'n_tokens_neox': 856, 'n_words': 282}