.net 中 PerformanceCounter 类的用法是什么?

发布于 2024-11-28 05:07:10 字数 68 浏览 1 评论 0原文

我从事这门课上遇到的企业图书馆绩效工作。现在PerformanceCounter类的用法是什么?

I worked on enterprise library performance that I met this class. Now what is the usage of PerformanceCounter class?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夜夜流光相皎洁 2024-12-05 05:07:11

可以使用不同的性能计数器类型,涵盖不同的性能需求。它们的范围从计数到计算平均值。某些性能计数器类型仅适用于特殊情况,但以下列表包含您通常会使用的最常见类型 - 本文将介绍:

NumberOfItems32 - 计算项目数量的计数器。您可以使用它来计算执行操作的频率或计算您处理的项目总数。

RateOfCountsPerSecond32 - 跟踪每秒项目或操作数量的计数器。

AverageTimer32 - 测量执行操作所需的平均时间的计数器。计数器是根据经过的总时间与该时间内完成的项目数的比率来计算的。这伴随着...

AverageBase - AverageTimer32 的基本计数器,用于计算在经过的时间内完成的项目数。

您将在 System.Diagnostics.PerformanceCounterType 枚举中找到性能计数器类型。该枚举中找到的一些计数器以“Base”结尾,这表明它们是执行计算的其他计数器(例如 AverageTimer32)的支持计数器。每当您设置执行计算的计数器时,您都需要设置一个支持的“基础”计数器。

摘自此处

Different performance counter types are available, covering different performance interests. They range from counts to those which calculate averages. Some of the performance counter types are for special situations only, but the following list contains the most common types you will normally use - and this article is covering:

NumberOfItems32 - a counter that counts the number of items. You can use it to calculate how often an operation was performed or to count the total number of items you processed.

RateOfCountsPerSecond32 - a counter that tracks down the number of items or operations per second.

AverageTimer32 - a counter that measures the average time required to perform an operation. The counter is calculated by the ratio of the total time elapsed and the number of items completed during that time. This comes along with ...

AverageBase - the base counter for AverageTimer32 which counts the number of items completed during the elapsed time.

You will find the performance counter types in the System.Diagnostics.PerformanceCounterType enumeration. Some of the counters found in that enumeration end with "Base" which indicates them as supporting counters for other counters which perform calculations (such as AverageTimer32). Whenever you set up a counter that performs calculations, you'll need to set up a supporting "Base" - counter.

Taken from here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文