用记事本或者VS开发php?name=%B9%A4%BE%DF" class="t_tag" style="word-wrap: break-word; line-height: normal; cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(255, 0, 0); white-space: nowrap; ">工具写上自己所要添加的内容,如:
<?xml version = "1.0" encoding = "utf-8"?>
<CounterSet Name = "Custom" CounterSetType = "Custom Set">
<CounterCategories>
<CounterCategory Name = "Memory">
<Counter>
<Counter Name = "% Committed Bytes In Use" />
<Counter Name ="Available Mbytes" />
</Counter>
</CounterCategory>
<CounterCategory>
<Counters>
<Counter Name = "% Processor Time">
<ThresholdRules>
<ThresholdRule Classname = "Microsft.VisualStudio.TestTools.WebStress.Rules.ThresholdRuleCompareConstant,Microsft.VisualStudio.QualityTools.LoadTest">
<RuleParameters>
<RuleParameters Name = "AlertIfOver" Value = "True" />
<RuleParameters Name = "WarningThreshold" Value = "80" />
<RuleParameters Name = "CriticalThreshold" Value = "90" />
</RuleParameters>
</ThresholdRule>
</ThresholdRules>
</Counter>
</Counters>
<Instances>
<Instance Name = "*"/>
</Instances>
</CounterCategory>
</CounterCategories>
</CounterSet>
然后保存为customcounter.CounterSet,并拷贝至【驱动盘】:\Microsoft Visual Studio \Common7\IDE\Templates\LoadTest\CounterSets\zh下,然后启动VSTS添加负载测试,在计数器集中就能显示所添加的计数器
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/