PerformanceCounterInstaller Class
Specifies an installer for the PerformanceCounter component.
Assembly: System.Configuration.Install (in System.Configuration.Install.dll)
System.MarshalByRefObject
System.ComponentModel.Component
System.Configuration.Install.Installer
System.Configuration.Install.ComponentInstaller
System.Diagnostics.PerformanceCounterInstaller
| Name | Description | |
|---|---|---|
![]() | PerformanceCounterInstaller() | Initializes a new instance of the PerformanceCounterInstaller class. |
| Name | Description | |
|---|---|---|
![]() | CanRaiseEvents | Gets a value indicating whether the component can raise an event.(Inherited from Component.) |
![]() | CategoryHelp | Gets or sets the descriptive message for the performance counter. |
![]() | CategoryName | Gets or sets the performance category name for the performance counter. |
![]() | CategoryType | Gets or sets the performance counter category type. |
![]() | Container | Gets the IContainer that contains the Component.(Inherited from Component.) |
![]() | Context | Gets or sets information about the current installation.(Inherited from Installer.) |
![]() | Counters | Gets a collection of data that pertains to the counters to install. |
![]() | DesignMode | |
![]() | Events | |
![]() | HelpText | Gets the help text for all the installers in the installer collection.(Inherited from Installer.) |
![]() | Installers | Gets the collection of installers that this installer contains.(Inherited from Installer.) |
![]() | Parent | Gets or sets the installer containing the collection that this installer belongs to.(Inherited from Installer.) |
![]() | Site | |
![]() | UninstallAction | Gets a value that indicates whether the performance counter should be removed at uninstall time. |
| Name | Description | |
|---|---|---|
![]() | Commit(IDictionary) | When overridden in a derived class, completes the install transaction.(Inherited from Installer.) |
![]() | CopyFromComponent(IComponent) | Copies all the properties from the specified component that are required at install time for a performance counter.(Overrides ComponentInstaller.CopyFromComponent(IComponent).) |
![]() | CreateObjRef(Type) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.(Inherited from MarshalByRefObject.) |
![]() | Dispose() | |
![]() | Dispose(Boolean) | |
![]() | Equals(Object) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | Finalize() | |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetLifetimeService() | Retrieves the current lifetime service object that controls the lifetime policy for this instance.(Inherited from MarshalByRefObject.) |
![]() | GetService(Type) | |
![]() | GetType() | |
![]() | InitializeLifetimeService() | Obtains a lifetime service object to control the lifetime policy for this instance.(Inherited from MarshalByRefObject.) |
![]() | Install(IDictionary) | Performs the installation.(Overrides Installer.Install(IDictionary).) |
![]() | IsEquivalentInstaller(ComponentInstaller) | Determines if the specified installer installs the same object as this installer.(Inherited from ComponentInstaller.) |
![]() | MemberwiseClone() | |
![]() | MemberwiseClone(Boolean) | Creates a shallow copy of the current MarshalByRefObject object.(Inherited from MarshalByRefObject.) |
![]() | OnAfterInstall(IDictionary) | Raises the AfterInstall event.(Inherited from Installer.) |
![]() | OnAfterRollback(IDictionary) | Raises the AfterRollback event.(Inherited from Installer.) |
![]() | OnAfterUninstall(IDictionary) | Raises the AfterUninstall event.(Inherited from Installer.) |
![]() | OnBeforeInstall(IDictionary) | Raises the BeforeInstall event.(Inherited from Installer.) |
![]() | OnBeforeRollback(IDictionary) | Raises the BeforeRollback event.(Inherited from Installer.) |
![]() | OnBeforeUninstall(IDictionary) | Raises the BeforeUninstall event.(Inherited from Installer.) |
![]() | OnCommitted(IDictionary) | |
![]() | OnCommitting(IDictionary) | Raises the Committing event.(Inherited from Installer.) |
![]() | Rollback(IDictionary) | Restores the computer to the state it was in before the installation.(Overrides Installer.Rollback(IDictionary).) |
![]() | ToString() | |
![]() | Uninstall(IDictionary) | Removes an installation.(Overrides Installer.Uninstall(IDictionary).) |
| Name | Description | |
|---|---|---|
![]() | AfterInstall | Occurs after the Install methods of all the installers in the Installers property have run.(Inherited from Installer.) |
![]() | AfterRollback | Occurs after the installations of all the installers in the Installers property are rolled back.(Inherited from Installer.) |
![]() | AfterUninstall | Occurs after all the installers in the Installers property perform their uninstallation operations.(Inherited from Installer.) |
![]() | BeforeInstall | |
![]() | BeforeRollback | Occurs before the installers in the Installers property are rolled back.(Inherited from Installer.) |
![]() | BeforeUninstall | Occurs before the installers in the Installers property perform their uninstall operations.(Inherited from Installer.) |
![]() | Committed | Occurs after all the installers in the Installers property have committed their installations.(Inherited from Installer.) |
![]() | Committing | Occurs before the installers in the Installers property committ their installations.(Inherited from Installer.) |
![]() | Disposed |
The following information might help provide a performance improvement when installing performance counters at application startup. Performance counter categories installed with .NET Framework version 2.0 use separate shared memories, with each performance counter category having its own memory. You can specify the size of separate shared memory by creating a DWORD named FileMappingSize in the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<category name>\Performance. The FileMappingSize value is set to the shared memory size of the category. The default size is 131072 decimal. If the FileMappingSize value is not present, the fileMappingSize attribute value for the performanceCounters element specified in the Machine.config file is used, causing additional overhead for configuration file processing. You can realize a performance improvement for application startup by setting the file mapping size in the registry.
The following code example demonstrates how to create a PerformanceCounterInstaller object and add it to an InstallerCollection.
using System; using System.Configuration.Install; using System.Diagnostics; using System.ComponentModel; [RunInstaller(true)] public class MyPerformanceCounterInstaller : Installer { public MyPerformanceCounterInstaller() { try { // Create an instance of 'PerformanceCounterInstaller'. PerformanceCounterInstaller myPerformanceCounterInstaller = new PerformanceCounterInstaller(); // Set the 'CategoryName' for performance counter. myPerformanceCounterInstaller.CategoryName = "MyPerformanceCounter"; CounterCreationData myCounterCreation = new CounterCreationData(); myCounterCreation.CounterName = "MyCounter"; myCounterCreation.CounterHelp = "Counter Help"; // Add a counter to collection of myPerformanceCounterInstaller. myPerformanceCounterInstaller.Counters.Add(myCounterCreation); Installers.Add(myPerformanceCounterInstaller); } catch (Exception e) { this.Context.LogMessage("Error occured :" + e.Message); } } public static void Main() { } }
Available since 1.1
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.




