Giter Site home page Giter Site logo

kouweizhong / metrics.net Goto Github PK

View Code? Open in Web Editor NEW

This project forked from etishor/metrics.net

0.0 1.0 0.0 3.34 MB

The Metrics.NET library provides a way of instrumenting applications with custom metrics (timers, histograms, counters etc) that can be reported in various ways and can provide insights on what is happening inside a running application.

License: Apache License 2.0

metrics.net's Introduction

Metrics.NET

Build status Mono Build Status

###Intro

The Metrics.NET library provides a way of instrumenting applications with custom metrics (timers, histograms, counters etc) that can be reported in various ways and can provide insights on what is happening inside a running application.

This library is a .NET Port of the awesome Java metrics library by Coda Hale.

For a very good introduction on why metrics are necesary I highly recommand Coda Hale's talk about metrics and slides.

The library is published on NuGet can be installed with the following command:

Install-Package Metrics.NET

Supported runtimes: .NET 4.5.1, .NET 4.5, .NET 4.0 (on a separate branch) & Mono 3.8.0 ( tested on OsX )

The API of the library might change until a 1.X version will be made available.

###Visualization Demo

A demo of the visualization app is available here. This demo uses fake, generated values for the metrics.

The visualization app is also avaliable on github : Metrics.NET.FlotVisualization.

###Documentation

###Quick Usage Sample

public class SampleMetrics
{
    private readonly Timer timer = Metric.Timer("Requests", SamplingType.FavourRecent, Unit.Requests);
    private readonly Counter counter = Metric.Counter("ConcurrentRequests", Unit.Requests);

    public void Request(int i)
    {
        this.counter.Increment();
        using (this.timer.NewContext()) // measure until disposed
        {
            // do some work
        }
        this.counter.Decrement();
    }
}

###Adapters for other applications

Adapters integrate Metrics.NET with other libraries & frameworks.

###TODO A live list of my future plan

  • Enhance the visualization app to support contexts, tags, user values and set metrics
  • Push metrics out of process, to dedicated metrics service
  • Investigate the possibility of using zeromq to delegate metrics to another process - for across cluster metrics
  • Adapter for graphite and other existing solutions for aggregating metrics
  • Investigate the possibility of using Redis as an off-process metrics container (the collections behind the metrics seem to map to redis data types)
  • Investigate the possibility for backend to receive metrics from client js app (not sure it makes sense to capture metrics from js apps - maybe from SPAs)

###License .NET Port of the awesome Java metrics library by Coda Hale

This port is also inspired and contains some code from Daniel Crenna's port of the same library.

I have decided to write another .NET port of the same library since Daniel does not actively maintain metrics-net. I've also wanted to better understand the internals of the library and try to provide a better API, more suitable for the .NET world.

This port will always keep the same license as the original Java Metrics library.

The original metrics project is released under this therms (https://github.com/dropwizard/metrics): Copyright (c) 2010-2013 Coda Hale, Yammer.com Published under Apache Software License 2.0, see LICENSE

The Daniel Crenna's idiomatic port is released under this therms (https://github.com/danielcrenna/metrics-net): The original Metrics project is Copyright (c) 2010-2011 Coda Hale, Yammer.com This idiomatic port of Metrics to C# and .NET is Copyright (c) 2011 Daniel Crenna Both works are published under The MIT License, see LICENSE

This port ( Metrics.NET ) is release under Apache 2.0 License ( see LICENSE ) Copyright (c) 2014 Iulian Margarintescu

metrics.net's People

Contributors

etishor avatar alhardy avatar kucheruk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.