本文介绍了性能监视器不可思议?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在IIS7中托管了一个WCF服务,在启动时我运行以下代码:

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);
    }

我可以看到该类别已被删除并创建,但它仍未显示在Performans Monitor中?

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?

性能监视器是否不真实?或者我做错了什么?还有maby其他更好的软件用于此任务吗?

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

BestRegards

推荐答案


这篇关于性能监视器不可思议?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 15:04
查看更多