Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Pereingo/statsd-csharp-client
Statsd C# Client
https://github.com/Pereingo/statsd-csharp-client
c-sharp nuget statsd statsd-client
Last synced: 18 days ago
JSON representation
Statsd C# Client
- Host: GitHub
- URL: https://github.com/Pereingo/statsd-csharp-client
- Owner: Pereingo
- License: mit
- Archived: true
- Created: 2012-07-10T17:20:58.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2019-03-04T22:06:26.000Z (over 5 years ago)
- Last Synced: 2024-05-19T12:15:18.931Z (6 months ago)
- Topics: c-sharp, nuget, statsd, statsd-client
- Language: C#
- Homepage:
- Size: 961 KB
- Stars: 111
- Watchers: 14
- Forks: 67
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
Statsd Client - DEPRECATED
==========================This project is deprecated as of March 4, 2019. There's no official maintainer, and better alternatives exist. Security only related updates will be considered going forward. Currently active versions will remain on NuGet.
We suggest migrating to [JustEat.StatsD](https://github.com/justeat/JustEat.StatsD), which has a very similar API to this project, plenty of additional features, and is actively maintained.
Thanks to all the contributors and your many PRs and reported issues over the years, the numerous developers that have forked or been inspired by this client, and everyone that used it successfully in production!
# THIS PROJECT IS DEPRECATED
Original readme...
---
[![Build status](https://ci.appveyor.com/api/projects/status/fklgn25u3k66qu3v?svg=true)](https://ci.appveyor.com/project/DarrellMozingo/statsd-csharp-client)
[![NuGet Version](http://img.shields.io/nuget/v/StatsdClient.svg?style=flat)](https://www.nuget.org/packages/StatsdClient/)A .NET Standard compatible C# client to interface with Etsy's excellent [statsd](https://github.com/etsy/statsd) server.
Install the client via NuGet with the [StatsdClient package](http://nuget.org/packages/StatsdClient).
## Usage
At app startup, configure the `Metrics` class:
``` C#
Metrics.Configure(new MetricsConfig
{
StatsdServerName = "hostname",
Prefix = "myApp.prod"
});
```Start measuring all the things!
``` C#
Metrics.Counter("stat-name");
Metrics.Time(() => myMethod(), "timer-name");
var result = Metrics.Time(() => GetResult(), "timer-name");
var result = await Metrics.Time(async () => await myAsyncMethod(), "timer-name");
Metrics.GaugeAbsoluteValue("gauge-name", 35);
Metrics.GaugeDelta("gauge-name", -5);
Metrics.Set("something-special", "3");using (Metrics.StartTimer("stat-name"))
{
// Lots of code here
}
```## Advanced Features
To enable these, see the `MetricsConfig` class discussed above.
* `UseTcpProtocol`: sends metrics to statsd via TCP. While supported, UDP is recommended in most cases. If you need TCP reliability, a relay service running locally on the server which you'd send UDP to, and it would relay via TCP, is advised.
## Contributing
See the [Contributing](CONTRIBUTING.md) guidelines.