ve-global / ve-metrics-statsdclient-csharp

Wrappers and utilities for VE statsd infrastructure
MIT License
2 stars 7 forks source link

Add WebForms package to README #8

Open andyroyle opened 8 years ago

andyroyle commented 8 years ago

need to add a link to the package and sample code to hook it up

@turowicz can you paste the boilerplate code you used to hook up the WebForms module?

turowicz commented 8 years ago

@andyroyle here it is:

PM> Install-Package Ve.Metrics.StatsDClient.WebForms

In Web.config:

<system.webServer>
  <modules>
    <add name="StatsDModule" type="Ve.Metrics.StatsDClient.WebForms.StatsDModule" />
  </modules>
</system.webServer>

In Global.asax.cs:

StatsDModule.Statsd = new VeStatsDClient(new StatsdConfig()
{
    AppName = "redpanda.trackback.api",
    Datacenter = ConfigurationManager.AppSettings["statsd.datacenter"],
    Host = ConfigurationManager.AppSettings["statsd.host"]
});