C# Class Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.Implementation.PerformanceCounterUtility

Utility functionality for performance counter collection.
Afficher le fichier Open project: Microsoft/ApplicationInsights-dotnet-server Class Usage Examples

Méthodes publiques

Méthode Description
CreateAndValidateCounter ( string perfCounterName, IEnumerable win32Instances, IEnumerable clrInstances, bool &usesInstanceNamePlaceholder, string &error ) : PerformanceCounter

Validates the counter by parsing.

FormatPerformanceCounter ( PerformanceCounter pc ) : string

Formats a counter into a readable string.

FormatPerformanceCounter ( string categoryName, string counterName, string instanceName ) : string

Formats a counter into a readable string.

InvalidatePlaceholderCache ( ) : void

Invalidates placeholder cache.

IsWebAppRunningInAzure ( ) : bool

Searches for the environment variable specific to Azure web applications and confirms if the current application is a web application or not.

MatchInstancePlaceholder ( string instanceName ) : Match

Matches an instance name against the placeholder regex.

ParsePerformanceCounter ( string performanceCounter, IEnumerable win32Instances, IEnumerable clrInstances ) : PerformanceCounter

Parses a performance counter canonical string into a PerformanceCounter object.

This method also performs placeholder expansion.

ParsePerformanceCounter ( string performanceCounter, IEnumerable win32Instances, IEnumerable clrInstances, bool &usesInstanceNamePlaceholder ) : PerformanceCounter

Parses a performance counter canonical string into a PerformanceCounter object.

This method also performs placeholder expansion.

SDKVersionPrefix ( ) : string

Differentiates the SDK version prefix for azure web applications with standard applications.

Private Methods

Méthode Description
ExpandInstanceName ( string instanceName, IEnumerable win32Instances, IEnumerable clrInstances, bool &usesPlaceholder ) : string
FindProcessInstance ( int pid, IEnumerable instances, string categoryName, string counterName ) : string
GetClrProcessInstances ( ) : IList
GetInstanceForClrProcess ( IEnumerable clrInstances ) : string
GetInstanceForCurrentW3SvcWorker ( ) : string
GetInstanceForWin32Process ( IEnumerable win32Instances ) : string
GetInstanceFromApplicationDomain ( string domainFriendlyName ) : string
GetInstances ( string categoryName ) : IList
GetWin32ProcessInstances ( ) : IList

Method Details

CreateAndValidateCounter() public static méthode

Validates the counter by parsing.
public static CreateAndValidateCounter ( string perfCounterName, IEnumerable win32Instances, IEnumerable clrInstances, bool &usesInstanceNamePlaceholder, string &error ) : PerformanceCounter
perfCounterName string Performance counter name to validate.
win32Instances IEnumerable Windows 32 instances.
clrInstances IEnumerable CLR instances.
usesInstanceNamePlaceholder bool Boolean to check if it is using an instance name place holder.
error string Error message.
Résultat System.Diagnostics.PerformanceCounter

FormatPerformanceCounter() public static méthode

Formats a counter into a readable string.
public static FormatPerformanceCounter ( PerformanceCounter pc ) : string
pc System.Diagnostics.PerformanceCounter
Résultat string

FormatPerformanceCounter() public static méthode

Formats a counter into a readable string.
public static FormatPerformanceCounter ( string categoryName, string counterName, string instanceName ) : string
categoryName string
counterName string
instanceName string
Résultat string

InvalidatePlaceholderCache() public static méthode

Invalidates placeholder cache.
public static InvalidatePlaceholderCache ( ) : void
Résultat void

IsWebAppRunningInAzure() public static méthode

Searches for the environment variable specific to Azure web applications and confirms if the current application is a web application or not.
public static IsWebAppRunningInAzure ( ) : bool
Résultat bool

MatchInstancePlaceholder() public static méthode

Matches an instance name against the placeholder regex.
public static MatchInstancePlaceholder ( string instanceName ) : Match
instanceName string Instance name to match.
Résultat System.Text.RegularExpressions.Match

ParsePerformanceCounter() public static méthode

Parses a performance counter canonical string into a PerformanceCounter object.
This method also performs placeholder expansion.
public static ParsePerformanceCounter ( string performanceCounter, IEnumerable win32Instances, IEnumerable clrInstances ) : PerformanceCounter
performanceCounter string
win32Instances IEnumerable
clrInstances IEnumerable
Résultat System.Diagnostics.PerformanceCounter

ParsePerformanceCounter() public static méthode

Parses a performance counter canonical string into a PerformanceCounter object.
This method also performs placeholder expansion.
public static ParsePerformanceCounter ( string performanceCounter, IEnumerable win32Instances, IEnumerable clrInstances, bool &usesInstanceNamePlaceholder ) : PerformanceCounter
performanceCounter string
win32Instances IEnumerable
clrInstances IEnumerable
usesInstanceNamePlaceholder bool
Résultat System.Diagnostics.PerformanceCounter

SDKVersionPrefix() public static méthode

Differentiates the SDK version prefix for azure web applications with standard applications.
public static SDKVersionPrefix ( ) : string
Résultat string