当前位置: 首页>>代码示例>>C#>>正文


C# PerformanceCounterType类代码示例

本文整理汇总了C#中PerformanceCounterType的典型用法代码示例。如果您正苦于以下问题:C# PerformanceCounterType类的具体用法?C# PerformanceCounterType怎么用?C# PerformanceCounterType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PerformanceCounterType类属于命名空间,在下文中一共展示了PerformanceCounterType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateCounter

        public static PerformanceCounter CreateCounter(string name, string description, PerformanceCounterType type)
        {
            if (_countersAllowed == false)
            {
                return null;
            }

            string categoryName = Application.ProductName + "." + name;
            if (PerformanceCounterCategory.Exists(categoryName) == false)
            {
                CounterCreationDataCollection counters = new CounterCreationDataCollection();

                CounterCreationData counterData = new CounterCreationData();
                counterData.CounterName = name;
                counterData.CounterHelp = description;
                counterData.CounterType = type;

                counters.Add(counterData);

                PerformanceCounterCategory category = PerformanceCounterCategory.Create(categoryName, "Category for the counters of " + Application.ProductName,
                    PerformanceCounterCategoryType.SingleInstance, counters);
            }

            PerformanceCounter counter = new PerformanceCounter(categoryName, name, string.Empty, false);
            return counter;
        }
开发者ID:redrhino,项目名称:DotNetConnectTerminal,代码行数:26,代码来源:PerformanceCounterHelper.cs

示例2: PerformanceCounterSample

 internal PerformanceCounterSample(string path,
                        string instanceName,
                        double cookedValue,
                        UInt64 rawValue,
                        UInt64 secondValue,
                        uint multiCount,
                        PerformanceCounterType counterType,
                        UInt32 defaultScale,
                        UInt64 timeBase,
                        DateTime timeStamp,
                        UInt64 timeStamp100nSec,
                        UInt32 status)
 {
     _path = path;
     _instanceName = instanceName;
     _cookedValue = cookedValue;
     _rawValue = rawValue;
     _secondValue = secondValue;
     _multiCount = multiCount;
     _counterType = counterType;
     _defaultScale = defaultScale;
     _timeBase = timeBase;
     _timeStamp = timeStamp;
     _timeStamp100nSec = timeStamp100nSec;
     _status = status;
 }
开发者ID:40a,项目名称:PowerShell,代码行数:26,代码来源:CounterSample.cs

示例3: PerformanceCounterDefinition

 internal PerformanceCounterDefinition(string categoryName, string counterName, string counterHelp, PerformanceCounterType counterType)
 {
     _categoryName = categoryName;
     _counterName = counterName;
     _counterHelp = counterHelp;
     _counterType = counterType;
 }
开发者ID:Rejendo,项目名称:orleans,代码行数:7,代码来源:PerformanceCounterDefinition.cs

示例4: CreateCounter

 public IICPerformanceCounter CreateCounter(string counterName, PerformanceCounterType counterType)
 {
     IICPerformanceCounter counter = new IICPerformanceCounter();
     counter._rawAttr = new IICPerformanceCounterAttribute(counterName, counterType);
     _counters.Add(counter);
     return counter;
 }
开发者ID:amwtke,项目名称:commonlibrary,代码行数:7,代码来源:IICPerformanceCounterCategory.cs

示例5: CounterCreationData

	public CounterCreationData(String counterName, String counterHelp,
							   PerformanceCounterType counterType)
			{
				this.counterName = counterName;
				this.counterHelp = counterHelp;
				this.counterType = counterType;
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:7,代码来源:CounterCreationData.cs

示例6: CounterCreationDataInfo

 public CounterCreationDataInfo(string counterName, string instanceName, PerformanceCounterType counterType, string counterHelp)
 {
     this.counterName = counterName;
     this.instanceName = instanceName;
     this.counterHelp = counterHelp;
     this.counterType = counterType;
 }
开发者ID:AnthonyMastrean,项目名称:terrarium2,代码行数:7,代码来源:Installer.cs

示例7: RunPerformanceAsync

        public async Task RunPerformanceAsync(string name, PerformanceCounterType performanceCounterType, TimeframeType timeframeType, IProgress<Tuple<PerformanceCounterType, PerfCounterModel>> progress)
        {
            await Task.Run(async () =>
            {
                var random = new Random();
                int prevPoint = 0;

                while (true)
                {
                    await Task.Yield();

                    int point = prevPoint > 0 ? prevPoint : startPoint;

                    // Update the point price by a random factor of the range percent
                    int number = (point + (int)(random.NextDouble() * random.Next(0, 30))) - random.Next(0, 50);

                    if (number < minPoint)
                    {
                        number = random.Next(0, 10);
                    }
                    else if (number > maxPoint)
                    {
                        number = 100;
                    }

                    progress.Report(new Tuple<PerformanceCounterType, PerfCounterModel>(performanceCounterType, new PerfCounterModel { Timestamp = DateTime.Now, Value = number }));

                    await Task.Delay(250);

                    prevPoint = number;
                }
            }).ConfigureAwait(false);
        }
开发者ID:nikitadev,项目名称:SCVMM,代码行数:33,代码来源:TestMonitoringService.cs

示例8: PerfCounterCreationData

 public PerfCounterCreationData(PerformanceCounterName name, PerformanceCounterType type, string displayName, string helpText)
 {
     counterName = name;
     counterType = type;
     counterDisplayName = displayName;
     counterHelpText = helpText;
 }
开发者ID:CrossPoint,项目名称:elastic-db-tools,代码行数:7,代码来源:PerfCounterInstance.cs

示例9: CounterDescriptor

 public CounterDescriptor(string name, string help, PerformanceCounterType type)
     : this()
 {
     Name = name;
     Help = help;
     Type = type;
 }
开发者ID:RebelCMS,项目名称:rebelcmsxu5,代码行数:7,代码来源:CounterDescriptor.cs

示例10: PerformanceCounterData

 internal PerformanceCounterData(string name, string description, PerformanceCounterType counterType, PerformanceCounterActionMapping[] mappings)
 {
     this.Name = name;
     this.Description = description;
     this.CounterType = counterType;
     this.Mappings = mappings;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:PerformanceCounterData.cs

示例11: CounterAttribute

 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="name">Name of the counter</param>
 /// <param name="info">Information about the counter</param>
 /// <param name="counterType">Type of counter</param>
 /// <param name="baseAutoIncreased">if true, each time the performance counter increased/decreased its base will be increased/decrease on 1 point. Otherwise all that base management will need to be handed on client code</param>
 /// <seealso cref="PerformanceCounterType"/>
 public CounterAttribute(string name, string info, PerformanceCounterType counterType, bool baseAutoIncreased)
     : base()
 {
     this.name = name;
     this.info = info;
     this.counterType = counterType;
     this.baseAutoIncreased = baseAutoIncreased;
 }
开发者ID:rag2111,项目名称:Hexa.Core,代码行数:16,代码来源:CounterAttribute.cs

示例12: CounterCreationData

		public CounterCreationData (string counterName, 
			string counterHelp, 
			PerformanceCounterType counterType)
		{
			CounterName = counterName;
			CounterHelp = counterHelp;
			CounterType = counterType;
		}
开发者ID:Xipas,项目名称:Symplified.Auth,代码行数:8,代码来源:CounterCreationData.cs

示例13: AddDefinition

        protected PerformanceCounterDefinition AddDefinition(string counterName, string counterHelp, PerformanceCounterType counterType)
        {
            var definition = new PerformanceCounterDefinition(_categoryName, counterName, counterHelp, counterType);

            _counterDefinitions.Add(definition.GetCreationData());

            return definition;
        }
开发者ID:Rejendo,项目名称:orleans,代码行数:8,代码来源:InstrumentationManager.cs

示例14: AddCounter

 public FluentCategoryConfigurator AddCounter(
     string name, 
     string help = "", 
     PerformanceCounterType type = PerformanceCounterType.NumberOfItems32)
 {
     _counters.Add(new CounterCreationData(name, help, type));
     return this;
 }
开发者ID:AnthonyMastrean,项目名称:Watson,代码行数:8,代码来源:FluentCategoryConfigurator.cs

示例15: STPPerformanceCounter

 // Methods
 public STPPerformanceCounter(
     string counterName, 
     string counterHelp, 
     PerformanceCounterType pcType)
 {
     this._counterName = counterName;
     this._counterHelp = counterHelp;
     this._pcType = pcType;
 }
开发者ID:BackupTheBerlios,项目名称:seleon,代码行数:10,代码来源:STPPerformanceCounter.cs


注:本文中的PerformanceCounterType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。