PerformanceCounterInstaller クラス
アセンブリ: System.Configuration.Install (system.configuration.install.dll 内)


パフォーマンス カウンタをインストールする場合、ここで説明する情報がアプリケーション起動時のパフォーマンスの向上に役立ちます。.NET Framework Version 2.0 と同時にインストールされるパフォーマンス カウンタ カテゴリでは独立した共有メモリが使用され、各パフォーマンス カウンタ カテゴリが独自のメモリを持ちます。DWORD レジストリ キーの HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<category name>\Performance\FileMappingSize を作成し、131072 (現在の既定値) などの値を指定することで、独立した共有メモリのサイズを指定できます。このレジストリ キーが存在しない場合、machine.config で指定されている performanceCounters 要素の fileMappingSize 属性値が使用されます。これにより、構成ファイルの処理のオーバーヘッドが増加します。このレジストリ キーを使用することで、アプリケーションの起動時のパフォーマンスを向上できます。

Imports System Imports System.Configuration.Install Imports System.Diagnostics Imports System.ComponentModel <RunInstaller(True)> _ Public Class MyPerformanceCounterInstaller Inherits Installer Public Sub New() Try ' Create an instance of 'PerformanceCounterInstaller'. Dim myPerformanceCounterInstaller As New PerformanceCounterInstaller() ' Set the 'CategoryName' for performance counter. myPerformanceCounterInstaller.CategoryName = "MyPerformanceCounter" Dim myCounterCreation As New CounterCreationData() myCounterCreation.CounterName = "MyCounter" myCounterCreation.CounterHelp = "Counter Help" ' Add a counter to collection of myPerformanceCounterInstaller. myPerformanceCounterInstaller.Counters.Add(myCounterCreation) Installers.Add(myPerformanceCounterInstaller) Catch e As Exception Console.WriteLine("Error occured :" + e.Message) End Try End Sub 'New Public Shared Sub Main() End Sub 'Main End Class 'MyPerformanceCounterInstaller
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) { Console.WriteLine("Error occured :"+e.Message); } } public static void Main() { } }
#using <System.dll> #using <System.Configuration.Install.dll> using namespace System; using namespace System::Configuration::Install; using namespace System::Diagnostics; using namespace System::ComponentModel; [RunInstaller(true)] ref class MyPerformanceCounterInstaller: public Installer { public: MyPerformanceCounterInstaller() { try { // Create an instance of 'PerformanceCounterInstaller'. PerformanceCounterInstaller^ myPerformanceCounterInstaller = gcnew PerformanceCounterInstaller; // Set the 'CategoryName' for performance counter. myPerformanceCounterInstaller->CategoryName = "MyPerformanceCounter"; CounterCreationData^ myCounterCreation = gcnew 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 ) { Console::WriteLine( "Error occured :{0}", e->Message ); } } };
import System.*; import System.Configuration.Install.*; import System.Diagnostics.*; import System.ComponentModel.*; /** @attribute RunInstaller(true) */ public class MyPerformanceCounterInstaller extends Installer { public MyPerformanceCounterInstaller() { try { // Create an instance of 'PerformanceCounterInstaller'. PerformanceCounterInstaller myPerformanceCounterInstaller = new PerformanceCounterInstaller(); // Set the 'CategoryName' for performance counter. myPerformanceCounterInstaller.set_CategoryName( "MyPerformanceCounter"); CounterCreationData myCounterCreation = new CounterCreationData(); myCounterCreation.set_CounterName("MyCounter"); myCounterCreation.set_CounterHelp("Counter Help"); // Add a counter to collection of myPerformanceCounterInstaller. myPerformanceCounterInstaller.get_Counters().Add(myCounterCreation); InstallerCollection installers = null; installers.Add(myPerformanceCounterInstaller); } catch (System.Exception e) { Console.WriteLine("Error occured :" + e.get_Message()); } } //MyPerformanceCounterInstaller public static void main(String[] args) { } //main } //MyPerformanceCounterInstaller

System.MarshalByRefObject
System.ComponentModel.Component
System.Configuration.Install.Installer
System.Configuration.Install.ComponentInstaller
System.Diagnostics.PerformanceCounterInstaller


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からPerformanceCounterInstaller クラスを検索する場合は、下記のリンクをクリックしてください。

- PerformanceCounterInstaller クラスのページへのリンク