GithubHelp home page GithubHelp logo

hystrix.net.dashboard's Introduction

Hystrix.NET Dashboard

Quick setup

Setup the dashboard

  1. Create a MVC app
  2. Make Windows happy, as admin => netsh http add urlacl url=http://+:9000/ user=Everyone listen=yes
  3. Use the following code in the Startup
public partial class Startup
{
    public void Configuration(IAppBuilder app)
    {
        try
        {
            HystrixDashboard.Selfhost("http://+:9000/");
        }
        catch (HttpListenerException ex)
        {
            string command = $"netsh http add urlacl url=http://+:9000/ user=Everyone listen=yes";
            string exMessage = "Unable to start listener. Try: " + command;
            log.FatalException(exMessage, ex);
            throw new TargetInvocationException(exMessage, ex);
        }

        ...
    }
}

Setup Hystrix

  1. In the app which uses Hystrix.NET install Hystrix.NET.MetricsEventStream nuget package
  2. Make Windows happy, as admin => netsh http add urlacl url=http://+:10900/ user=Everyone listen=yes
  3. Create Hystrix startup class
public static class HystrixStartup
{
    static HystrixMetricsStreamServer metricsServer;

    public static void Start()
    {
        try
        {
            metricsServer = new HystrixMetricsStreamServer(@"http://+:10900/my-app/", 20, TimeSpan.FromSeconds(1));
            metricsServer.Start();
        }
        catch (Exception ex)
        {
            //log.Error(ex);
            throw;
        }
    }

    public static void Stop()
    {
        try
        {
            metricsServer.Stop();
        }
        catch (Exception ex)
        {
            //log.Fatal("Unable to stop Hystrix properly. Exiting without crashing. There is a chance that some resources are not disposed properly.", ex);
        }
    }
}
  1. Initialize hystrix in the app Startup
HystrixStartup.Start(null);
var properties = new AppProperties(app.Properties);
CancellationToken token = properties.OnAppDisposing;
if (token != CancellationToken.None)
{
    token.Register(() =>
    {
        HystrixStartup.Stop();
    });
}

hystrix.net.dashboard's People

Contributors

mynkow avatar sinstraliz avatar sdluxeon avatar

Stargazers

俞正东 avatar  avatar

Watchers

 avatar James Cloos avatar  avatar Asen Popov avatar Denitsa Atanasova avatar Stoyan Dobrev avatar  avatar Konstantin Tenekedzhiev avatar Lyubomir Mitkov avatar Kalin Venkov avatar Stanimir Venkov avatar  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.