问题描述
嗨
我在Visual Studio 2015上创建了加载执行,在我的代码中,我通过命令创建了新的性能类别
i created load execution on visual studio 2015, in my code i created new performancecategory via command
performancecategory.create作为单个实例,当然,我将该类别映射到应用程序"部分下-添加计数器
performancecategory.create as single instance, of course, i mapped that category under Application section - add counters
然后我为此创建了PerformanceCounters
then i created performancecounters for it as
PerformanceCounter x =新的PerformanceCounter(类别,计数器,false)
PerformanceCounter x = new PerformanceCounter(category,counter,false)
x.RawValue =数字;
x.RawValue = number;
x.Close();
x.Close();
问题是我可以在负载图中看到计数器正在运行(样本为5秒),但是它只显示其中的一部分,而不是我通过执行创建的所有性能计数器.
the problem is that i can see the counter running in the load graph (sample is 5 seconds) but it show only few of them and not all the performance counters i create through the execution
有人可以解释我做错了什么,查看它的正确过程是什么?
can someone explain what i ma doing wrong and what is the correct process to view it ?
谢谢.
推荐答案
如何以及在何处创建自定义性能计数器?请提供示例以帮助我们理解问题.
How and where do you create your custom Performance Counters? Please provide a sample to help us understanding the problem.
请首先检查所有这些性能计数器是否在您的负载测试中被行使.然后请尝试执行以下步骤来解决本文中无法收集性能计数器的问题.
https://msdn.microsoft.com/en-us/library /ms404661(v=vs.100).aspx#TroubleShootingLoadTestsPerfCounters
Please check whether all these performance counters are exercised in your load test first. And then please try with following steps to troubleshooting the problem of Unable to Collect Performance Counters in this article.
https://msdn.microsoft.com/en-us/library/ms404661(v=vs.100).aspx#TroubleShootingLoadTestsPerfCounters
此外,请禁用性能计数器(可在负载图中看到),以确保这些计数器之间的效果.您可以留下一个未在负载图中显示的计数器来检查发生了什么.
In addition, please disable the performance counter which can be seen in the load graph to make sure the effect between these counters. You can leave one counter which not display in load graph to check what happened.
然后请使用控制面板"下的性能监视器->管理工具,以检查这些性能是否真正消耗完了.有时,并非所有性能计数器都在负载测试执行中包含数据,因为它们没有被消耗.
Then please using Performance Monitor under Control Panel -> Administrative Tools to check whether these performance really be Consumed. Sometimes, not all performance counters has data in load test execution, because they don't be Consumed.
最好的问候,
Weiwei
Best Regards,
Weiwei
这篇关于加载执行期间未显示性能计数器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!