C# Other
Clone or download
Latest commit bffc2cd Aug 3, 2018
Failed to load latest commit information.
benchmarks re-run benchmarks Aug 3, 2018
build package update, netcore 2.1.1 and test packages Jul 8, 2018
sandbox/MetricsSandbox resharper warnings May 11, 2018
src #294 fix spelling in logs Aug 1, 2018
test #268 by default when using exponentially decaying reservoir, discard… Jul 8, 2018
tools #190 sourcelink Oct 16, 2017
.gitattributes initial commit Apr 22, 2016
.gitignore adding cake build script Feb 17, 2017
.travis.yml buid update - specify dotnet sdk 2.0.0 preview 1 Jun 10, 2017
AppMetrics.ruleset #186 removing dependency on Microsoft DI and configuration Sep 2, 2017
AppMetrics.sln #242 net core 2.1 updates Mar 31, 2018
AppMetrics.sln.DotSettings updated dotsettings Feb 2, 2018
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md May 5, 2018
CONTRIBUTING.md updating contribution guidelines May 5, 2018
GitReleaseManager.yaml updating grm config Feb 6, 2018
LICENSE Initial commit Apr 22, 2016
NuGet.config aspnet core rtm update, defaultroute handler no longer runs for attri… Jun 30, 2016
PULL_REQUEST_TEMPLATE.md updating pr template Apr 7, 2017
README.md Fix spelling of `Dashboards` in README Jul 2, 2018
SUPPORT.md Create SUPPORT.md May 5, 2018
app-metrics.licenseheader #264 updating copyright headers May 5, 2018
appveyor.yml removing sdk install on appveyor build Jul 8, 2018
build.cake updating build to package pre-releases for nuget release without usin… May 5, 2018
build.ps1 adding cake build script Feb 17, 2017
build.sh travis build fix Jun 1, 2017
global.json package update, netcore 2.1.1 and test packages Jul 8, 2018
run-benchmarks.ps1 #3 Adding reservoir sampling benchmarks which compares uniform, slid… Nov 26, 2016
stylecop.json #264 updating copyright headers May 5, 2018
version.props bumping version to 3.0.0 May 5, 2018
xunit.runner.json #155 #157 middleware and dependent packages updated to use aspnet co… Jun 10, 2017


App Metrics App Metrics

Official Site License

What is App Metrics?

App Metrics is an open-source and cross-platform .NET library used to record metrics within an application. App Metrics can run on .NET Core or on the full .NET framework also supporting .NET 4.5.2. App Metrics abstracts away the underlaying repository of your Metrics for example InfluxDB, Graphite, Elasticsearch etc, by sampling and aggregating in memory and providing extensibility points to flush metrics to a repository at a specified interval.

App Metrics provides various metric types to measure things such as the rate of requests, counting the number of user logins over time, measure the time taken to execute a database query, measure the amount of free memory and so on. Metrics types supported are Gauges, Counters, Meters, Histograms and Timers and Application Performance Indexes Apdex.

App.Metrics includes an Exponentially Forward Decaying, Sliding Window and Algorithm R reservoir implementations. For more details on reservoir sampling see the docs.

Reporting Features

Application Health

App Metrics also provides a health checking library allowing you to monitor the health of your application through user defined checks.


Latest Builds, Packages & Repo Stats

Branch AppVeyor Travis Coverage
dev AppVeyor Travis Coveralls
master AppVeyor Travis Coveralls
Package Dev Release Pre-Release Release
App.Metrics MyGet Status NuGet Status NuGet Status
App.Metrics.Abstractions MyGet Status NuGet Status NuGet Status
App.Metrics.Core MyGet Status NuGet Status NuGet Status
App.Metrics.Formatters.Ascii MyGet Status NuGet Status NuGet Status
App.Metrics.Formatters.Json MyGet Status NuGet Status NuGet Status


Grafana Web Monitoring

Grafana/InfluxDB Generic Web Dashboard Demo

Grab the InfluxDB or Elasticsearch dashboard.

Grafana OAuth2 Client Web Monitoring

Grafana/InfluxDB Generic OAuth2 Web Dashboard Demo

Grab the InfluxDB or Elasticsearch dashboard

How to build

AppVeyor and Travis CI builds are triggered on commits and PRs to dev and master branches.

See the following for build arguments and running locally.

Configuration Description Default Environment Required
BuildConfiguration The configuration to run the build, Debug or Release Release All Optional
PreReleaseSuffix The pre-release suffix for versioning nuget package artifacts e.g. beta ci All Optional
CoverWith DotCover or OpenCover to calculate and report code coverage, None to skip. When not None, a coverage file and html report will be generated at ./artifacts/coverage OpenCover Windows Only Optional
SkipCodeInspect false to run ReSharper code inspect and report results, true to skip. When false, the code inspection html report and xml output will be generated at ./artifacts/resharper-reports false Windows Only Optional
BuildNumber The build number to use for pre-release versions 0 All Optional
LinkSources Source link support allows source code to be downloaded on demand while debugging true All Optional


Run build.ps1 from the repositories root directory.


With Arguments

	.\build.ps1 --ScriptArgs '-BuildConfiguration=Release -PreReleaseSuffix=beta -CoverWith=OpenCover -SkipCodeInspect=false -BuildNumber=1'

Linux & OSX

Run build.sh from the repositories root directory. Code Coverage reports are now supported on Linux and OSX, it will be skipped running in these environments.


With Arguments

	.\build.sh --ScriptArgs '-BuildConfiguration=Release -PreReleaseSuffix=beta -BuildNumber=1'

How to run benchmarks

App.Metrics includes benchmarking using BenchmarkDotNet. You can find the benchmark results here.

To run, fron the solution's root:

	cd .\benchmarks\App.Metrics.Benchmarks.Runner\
	dotnet run -c "Release" --framework netcoreapp2.0

You'll then be prompted to choose a benchmark to run which will output a markdown file with the result in directory .\benchmarks\App.Metrics.Benchmarks.Runner\BenchmarkDotNet.Artifacts\results.

Alternatively, you can run the same benchmarks from visual studio using xUnit.net in the benchmark project.


See the contribution guidlines for details.


Thanks for providing free open source licensing


This library is release under Apache 2.0 License ( see LICENSE ) Copyright (c) 2016 Allan Hardy


App Metrics is based on the Metrics.NET library, and at the moment uses the same reservoir sampling code from the original library which is a port of the Java Dropwizard Metrics library.

Metrics.NET Licensed under these terms: "Metrics.NET is release under Apache 2.0 License Copyright (c) 2014 Iulian Margarintescu" see LICENSE

Dropwizard Metrics Licensed under these terms*: "Copyright (c) 2010-2013 Coda Hale, Yammer.com Published under Apache Software License 2.0, see LICENSE"

Powered By NDepend