コード例 #1
0
        public static ClusterBuilder UsePerformanceCounters(this ClusterBuilder configuration, string applicationName, bool install = false)
        {
            Ensure.IsNotNull(configuration, "configuration");

            if (install)
            {
                PerformanceCounterListener.Install();
            }

            return(configuration.AddListener(new PerformanceCounterListener(applicationName)));
        }
コード例 #2
0
        /// <summary>
        /// Configures the cluster builder to use performance counters.
        /// </summary>
        /// <param name="builder">The cluster builder.</param>
        /// <param name="applicationName">The name of the application.</param>
        /// <param name="install">if set to <c>true</c> install the performance counters first.</param>
        /// <returns>A reconfigured cluster builder.</returns>
        public static ClusterBuilder UsePerformanceCounters(this ClusterBuilder builder, string applicationName, bool install = false)
        {
            Ensure.IsNotNull(builder, "builder");

            if (install)
            {
                PerformanceCounterListener.InstallPerformanceCounters();
            }

            return(builder.AddListener(new PerformanceCounterListener(applicationName)));
        }