/// <summary>
        ///     <para>Installs performance counters managed by this instance.</para>
        /// </summary>
        /// <remarks><para>This installer will check to see the counter categories already exist.  If any categories are missing,
        /// then the installer attempts to install all catgories.  If all categories were already installed, no action is taken.</para></remarks>
        public static void Install()
        {
            var allAreInstalled =
                GetInstance(InstallationInstanceName)._counters.Values
                .Select(counter => counter.CategoryName)
                .Distinct()
                .All(PerformanceCounterCategory.Exists);

            if (!allAreInstalled)
            {
                PerfCounterInstaller.Install(GetInstance(InstallationInstanceName)._counters.Values);
            }
        }
        /// <summary>
        ///     <para>Uninstalls performance counters managed by this instance.</para>
        /// </summary>
        public static void Uninstall()
        {
            var tempInstance = GetInstance(InstallationInstanceName);

            PerfCounterInstaller.Uninstall(tempInstance._category);
            PerfCounterInstaller.Uninstall(tempInstance._obsoleteCategories);
            lock (_instancesLock)
            {
                var oldInstances = _instances;
                var instances    = new Dictionary <string, Implementation>();
                Thread.MemoryBarrier();
                _instances = instances;
                foreach (var instance in oldInstances.Values)
                {
                    instance.RemoveInstance();
                }
            }
        }