在VSTS 2010 自定义计数器和其报警上线

发表于:2010-05-26来源:作者:点击数: 标签:报警VSTS定义vsts计数器
方法: 用记事本或者 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: n
方法:
用记事本或者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添加负载测试,在计数器集中就能显示所添加的计数器

原文转自:http://www.ltesting.net