Home > SOA Tips > .NET Developer > Introduction to .NET performance counters
SOA Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

.NET DEVELOPER

Introduction to .NET performance counters


Jim Mischel
07.20.2004
Rating: -2.67- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


This article from InformIT's .NET Reference Guide examines three things to be careful of when working with performance counters.


Windows performance counters monitor performance objects such as disk drives, CPU utilization, processes, threads, and memory. Many of these performance objects are included in all versions of Windows. Others are included only with specific applications or parts of the operating system. For example, the .NET runtime and SQL Server both define custom performance counters that monitor values that are unique to those applications. It's important to understand that a performance object is not necessarily a physical piece of hardware or even an operating system concept. For example, you can define a performance counter that reports the number of transactions posted per second in your ASP.NET Web application.

There are a couple of things you need to know when you get started exploring the world of Windows Performance Counters. The conceptual documentation is excellent in that it provides good context and explains very well the ideas behind performance monitoring and the things you can do with it. But after you've digested the conceptual documentation, making sense of the technical documentation can be quite a challenge. There are three things you should be careful of:

  • The Windows performance monitoring API is not well designed. Although the .NET Framework classes hide most of the warts and needless complexity, there are still a few places where the legacy API shows through.
  • The .NET Framework SDK documentation for the PerformanceCounter and PerformanceCounterCategory classes is based on the Windows Management and Instrumentation (WMI) documentation, which in turn is based on the documentation for the Performance Data Helper library and the original registry-based performance counters. In many cases the .NET documentation is copied verbatim from the badly written PDH library documentation from more than 10 years ago. Even the original registry interface documentation is difficult, which makes me wonder how anybody ever figured out how to use this stuff.
  • There is an unfortunate naming conflict between the high-resolution timer (accessible through the QueryPerformanceCounter and QueryPerformanceFrequence API calls as described in the previous section) and the Windows Performance Counter interface. The documentation uses the term "system timer" in most cases to refer to the high-resolution performance counter, but there are cases when it's easy to confuse the two.

I'm not saying that using performance counters is hard -- just that trying to get useful detailed information from the documentation is something of a challenge. Fortunately, the hard part is creating your own counters and writing data to them. Sampling existing counters turns out to be straightforward. Almost.

The .NET SDK documentation has a very good article entitled Introduction to Monitoring Performance Thresholds, which explains the performance counter subsystem in great detail.


You can read more about creating your own performance counters at InformIT.


Rate this Tip
To rate tips, you must be a member of SearchSOA.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Microsoft .NET Web services
Microsoft preps .NET 4.0 - framework improves on REST, MVC, JQuery support
How do I balance throughput requirements and interoperability?
APM software traces transactions across tiers, technologies
How you can learn M Grammar for Oslo modeling
Legacy modernization opens Windows for publisher
Former .NET Web developers ride Ruby and Rails application framework
Microsoft Oslo at PDC: Dial 'M' for modeling language
Yahoo proxy fight looms
New Microsoft site for architects
LAMP coders go hybrid route
Microsoft .NET Web services Research

Platforms and Servers
Tracking down managed memory leaks
Handling exceptions in .NET
.NET Compact Framework graphics
The Data Access Application Block
Decision time: .NET or J2EE?
A great .NET resource: .Net2TheMax
Delegates vs. interfaces in .NET
Project structure best practices
Working with PDFs in a .NET environment
Displaying errors with the error provider

.NET Developer
Programming Indigo
DataSets and Web services don't mix
Security in .NET 2.0
Tracking down managed memory leaks
Handling exceptions in .NET
.NET Compact Framework graphics
The Data Access Application Block
A great .NET resource: .Net2TheMax
Delegates vs. interfaces in .NET
Project structure best practices

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
Common Language Infrastructure  (SearchSOA.com)
Visual J#  (SearchSOA.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



SOA Trends and Strategy - SOA Education, SOA Development, SOA Implementations
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2001 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts