Performance Counter Category Names? (C#)

前端 未结 4 941
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-05 07:20

I\'m trying to program in a performance counter into my C# application that launches another process and checks the processor usage of that launched process. As I understand it,

4条回答
  •  无人及你
    2021-02-05 07:35

    You can assign them whatever you want. The Performance Monitor will simply show whatever category you choose and whatever counter name you choose for your particular need.

    CounterCreationDataCollection ccdc = new CounterCreationDataCollection();
    ccdc.Add(new CounterCreationData("Counter Title", "Counter Description", PerformanceCounterType.NumberOfItems32));
    PerformanceCounterCategory.Create("My Counter Category", "Category Description", PerformanceCounterCategoryType.Unknown, ccdc);
    

提交回复
热议问题