none
Performance monitor unrealible?

    Frage

  • 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);
            col.Add(counter);
    
            if (PerformanceCounterCategory.Exists(_categoryName))
                PerformanceCounterCategory.Delete(_categoryName);
    
            if (!PerformanceCounterCategory.Exists(_categoryName))
                category = PerformanceCounterCategory.Create(_categoryName, "MyApp Application Service Counters", PerformanceCounterCategoryType.MultiInstance, col);
            else
                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?

    BestRegards

    Montag, 12. März 2012 08:27

Alle Antworten

  • Looks like it is a refresh issue. You should be able to see the changes, if you kill and start Perfmon again.
    Mittwoch, 14. März 2012 13:01