Performance monitor unrealible?


  • Hi,

    I have a WCF service hosted in IIS7, at startup I run the following code :

    if ((_UsePerformanceCounters = bool.Parse(ConfigurationManager.AppSettings["UsePerformanceCounters"])))
            col = new CounterCreationDataCollection();
            counter = new CounterCreationData(_acountOfCurrentUsersCounterName, "Amount of current users", PerformanceCounterType.NumberOfItemsHEX32);
            if (PerformanceCounterCategory.Exists(_categoryName))
            if (!PerformanceCounterCategory.Exists(_categoryName))
                category = PerformanceCounterCategory.Create(_categoryName, "MyApp Application Service Counters", PerformanceCounterCategoryType.MultiInstance, col);
                Console.WriteLine("Counter already exists");
            if (PerformanceCounterCategory.CounterExists(_acountOfCurrentUsersCounterName, _categoryName))
                _amountOfCurrentUsers = new PerformanceCounter(_categoryName, _acountOfCurrentUsersCounterName, HostingEnvironment.MapPath("~"), false);

    I can see that the category is deleted and created but it do still not show up in the Performans Monitor?

    Id did showed up once but even when running delete on it it was never removed? After a long shutdown of the computer it however disappeared?

    Is Performance Monitor unrealible? Or what am I doing wrong? Is there maby other better softwares for this task?


    Montag, 12. März 2012 08:27

Alle Antworten