• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# PerformanceCounterType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: CreatePerformanceCounterData

 public static PerformanceCounterData CreatePerformanceCounterData(string category, string format, string name, string help, PerformanceCounterType type)
 {
     return new PerformanceCounterData()
     {
         Category = category,
         Name = string.Format(format, name),
         Help = help,
         Type = type,
     };
 }
开发者ID:smonteil,项目名称:azuremongospare,代码行数:10,代码来源:PerformanceCounterData.cs


示例17: CounterSample

 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 public CounterSample(long rawValue, long baseValue, long counterFrequency, long systemFrequency, long timeStamp, long timeStamp100nSec, PerformanceCounterType counterType, long counterTimeStamp) {
     this.rawValue = rawValue;
     this.baseValue = baseValue;
     this.timeStamp = timeStamp;
     this.counterFrequency = counterFrequency;
     this.counterType = counterType;
     this.timeStamp100nSec = timeStamp100nSec;
     this.systemFrequency = systemFrequency;
     this.counterTimeStamp = counterTimeStamp;
 }         
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:13,代码来源:CounterSample.cs


示例18: CounterSample

 public CounterSample(long rawValue,
     long baseValue,
     long counterFrequency,
     long systemFrequency,
     long timeStamp,
     long timeStamp100nSec,
     PerformanceCounterType counterType)
     : this(rawValue, baseValue, counterFrequency,
         systemFrequency, timeStamp, timeStamp100nSec,
         counterType, 0) {
 }
开发者ID:andyhebear,项目名称:SmartThreadPool,代码行数:11,代码来源:PerformanceCounter.cs


示例19: PerformanceCounterAttribute

	    protected PerformanceCounterAttribute(
			string categoryName, string counterName, PerformanceCounterType counterType, PerformanceCounterType? baseCounterType)
	    {
		    this.CategoryName = categoryName;
		    this.CounterName = counterName;
		    this.BaseCounterName = counterName + "Base";
		    this.CounterType = counterType;
		    this.BaseCounterType = baseCounterType;
			this.CategoryType=PerformanceCounterCategoryType.MultiInstance;
		    this.sharedDataRef = sharedData;
	    }
开发者ID:smartpcr,项目名称:Instrumentation,代码行数:11,代码来源:PerformanceCounterAttribute.cs


示例20: PerformanceCounterTypeToString

		/// <summary>
		/// Converts a PerformanceCounterType to a string.
		/// </summary>
		/// <param name="Type">The type.</param>
		public static string PerformanceCounterTypeToString(PerformanceCounterType Type)
		{
			switch (Type)
			{
				case PerformanceCounterType.MemoryBytes:
					return "bytes";
				case PerformanceCounterType.TimeMilliseconds:
					return "ms";
				default:
					throw new InvalidOperationException("PerformanceCounterType has invalid value " + Type.ToString());
			}
		}
开发者ID:cyecp,项目名称:moonsharp,代码行数:16,代码来源:PerformanceResult.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Period类代码示例发布时间:2022-05-24
下一篇:
C# PerfUtils类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap