Exemplo n.º 1
0
        /// <summary>
        /// Handles the performance counter installation if they don't
        /// already exist.
        /// </summary>
        /// <returns>The application's <see cref="PerfCounterSet" />.</returns>
        public static PerfCounterSet InstallPerfCounters()
        {
            bool           exists = PerformanceCounterCategory.Exists(Const.AuthServicePerf);
            PerfCounterSet perfCounters;

            perfCounters = new PerfCounterSet(false, true, Const.AuthServicePerf, Const.AuthServiceName);

            if (!exists)
            {
                AuthServiceHandler.InstallPerfCounters(perfCounters, null);
                AuthenticationEngine.InstallPerfCounters(perfCounters, null);

                perfCounters.Install();
            }

            return(perfCounters);
        }