Пример #1
0
        public static IAppBuilder InitializeGraphite(
            this IAppBuilder builder, HttpConfiguration httpConfiguration,
            Action <ConfigurationDsl> configure = null)
        {
            var graphiteApplication = new GraphiteApplication(httpConfiguration);

            graphiteApplication.Initialize(x => Configure(x, configure));
            builder.OnAppDisposing(() => graphiteApplication.Dispose());
            return(builder);
        }
Пример #2
0
        public static HttpConfiguration InitializeGraphite(
            this HttpConfiguration httpConfiguration,
            Action <ConfigurationDsl> configure = null)
        {
            var graphiteApplication = new GraphiteApplication(httpConfiguration);

            graphiteApplication.Initialize(x => Configure(x, configure));
            HostingEnvironment.StopListening += (s, e) => graphiteApplication.Dispose();
            return(httpConfiguration);
        }