PerformanceCounterInstaller 클래스

정의

PerformanceCounter 구성 요소에 대해 설치 관리자를 지정합니다.

public ref class PerformanceCounterInstaller : System::Configuration::Install::ComponentInstaller
public class PerformanceCounterInstaller : System.Configuration.Install.ComponentInstaller
type PerformanceCounterInstaller = class
    inherit ComponentInstaller
Public Class PerformanceCounterInstaller
Inherits ComponentInstaller
상속

예제

다음 코드 예제에서는 만드는 방법을 보여 줍니다.는 PerformanceCounterInstaller 개체에 추가 하는 InstallerCollection합니다.

#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 ) 
      {
          this->Context->LogMessage( "Error occurred : " + e->Message );
      }
   }
};
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 occurred :" + e.Message);
        }
    }
    public static void Main()
    {
    }
}
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
            Me.Context.LogMessage("Error occurred :" + e.Message)
        End Try
    End Sub
    Public Shared Sub Main()
    End Sub
End Class

설명

다음 정보를 애플리케이션 시작 시 성능 카운터를 설치 하는 경우 성능 향상을 해결할 수 있습니다. .NET Framework 버전 2.0과 함께 설치 하는 성능 카운터 범주는 자체 메모리가 있는 각 성능 카운터 범주를 사용 하 여 별도 공유 메모리를 사용 합니다. 레지스트리 키 <HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\category name>\Performance에 FileMappingSize라는 DWORD를 만들어 별도의 공유 메모리 크기를 지정할 수 있습니다. FileMappingSize 값 범주의 공유 메모리 크기 설정 됩니다. 기본 크기는 10 진수 131072입니다. FileMappingSize 값 없는 경우는 fileMappingSize 특성에 대 한 값을 performanceCounters 합니다 Machine.config 파일에 지정 된 요소를 사용할 구성 파일을 처리에 대 한 추가 오버 헤드를 유발 합니다. 레지스트리에서 파일 매핑 크기를 설정 하 여 애플리케이션 시작에 대 한 성능 향상을 이룰 수 있습니다.

생성자

PerformanceCounterInstaller()

PerformanceCounterInstaller 클래스의 새 인스턴스를 초기화합니다.

속성

CanRaiseEvents

구성 요소가 이벤트를 발생시킬 수 있는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 Component)
CategoryHelp

성능 카운터에 대해 설명하는 메시지를 가져오거나 설정합니다.

CategoryName

성능 카운터의 성능 범주 이름을 가져오거나 설정합니다.

CategoryType

성능 카운터 범주 형식을 가져오거나 설정합니다.

Container

IContainer을 포함하는 Component를 가져옵니다.

(다음에서 상속됨 Component)
Context

현재 설치에 대한 정보를 가져오거나 설정합니다.

(다음에서 상속됨 Installer)
Counters

설치할 카운터에 관한 데이터 컬렉션을 가져옵니다.

DesignMode

Component가 현재 디자인 모드인지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 Component)
Events

Component에 연결된 이벤트 처리기의 목록을 가져옵니다.

(다음에서 상속됨 Component)
HelpText

설치 관리자 컬렉션에 있는 모든 설치 관리자에 대한 도움말 텍스트를 가져옵니다.

(다음에서 상속됨 Installer)
Installers

이 설치 관리자에 포함된 설치 관리자 컬렉션을 가져옵니다.

(다음에서 상속됨 Installer)
Parent

이 설치 관리자가 속한 컬렉션을 포함하는 설치 관리자를 가져오거나 설정합니다.

(다음에서 상속됨 Installer)
Site

ComponentISite를 가져오거나 설정합니다.

(다음에서 상속됨 Component)
UninstallAction

설치 제거 시 성능 카운터를 제거할지 여부를 나타내는 값을 가져옵니다.

메서드

Commit(IDictionary)

파생 클래스에서 재정의할 때 설치 트랜잭션을 완료합니다.

(다음에서 상속됨 Installer)
CopyFromComponent(IComponent)

설치할 때 성능 카운터에 필요한 지정 구성 요소에서 모든 속성을 복사합니다.

CreateObjRef(Type)

원격 개체와 통신하는 데 사용되는 프록시 생성에 필요한 모든 관련 정보가 들어 있는 개체를 만듭니다.

(다음에서 상속됨 MarshalByRefObject)
Dispose()

Component에서 사용하는 모든 리소스를 해제합니다.

(다음에서 상속됨 Component)
Dispose(Boolean)

Component에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 해제할 수 있습니다.

(다음에서 상속됨 Component)
Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetLifetimeService()
사용되지 않음.

이 인스턴스의 수명 정책을 제어하는 현재의 수명 서비스 개체를 검색합니다.

(다음에서 상속됨 MarshalByRefObject)
GetService(Type)

Component 또는 해당 Container에서 제공하는 서비스를 나타내는 개체를 반환합니다.

(다음에서 상속됨 Component)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
InitializeLifetimeService()
사용되지 않음.

이 인스턴스의 수명 정책을 제어하는 수명 서비스 개체를 가져옵니다.

(다음에서 상속됨 MarshalByRefObject)
Install(IDictionary)

설치를 수행합니다.

IsEquivalentInstaller(ComponentInstaller)

지정한 설치 관리자에서 같은 개체를 설치 관리자로 설치했는지 확인합니다.

(다음에서 상속됨 ComponentInstaller)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
MemberwiseClone(Boolean)

현재 MarshalByRefObject 개체의 단순 복사본을 만듭니다.

(다음에서 상속됨 MarshalByRefObject)
OnAfterInstall(IDictionary)

AfterInstall 이벤트를 발생시킵니다.

(다음에서 상속됨 Installer)
OnAfterRollback(IDictionary)

AfterRollback 이벤트를 발생시킵니다.

(다음에서 상속됨 Installer)
OnAfterUninstall(IDictionary)

AfterUninstall 이벤트를 발생시킵니다.

(다음에서 상속됨 Installer)
OnBeforeInstall(IDictionary)

BeforeInstall 이벤트를 발생시킵니다.

(다음에서 상속됨 Installer)
OnBeforeRollback(IDictionary)

BeforeRollback 이벤트를 발생시킵니다.

(다음에서 상속됨 Installer)
OnBeforeUninstall(IDictionary)

BeforeUninstall 이벤트를 발생시킵니다.

(다음에서 상속됨 Installer)
OnCommitted(IDictionary)

Committed 이벤트를 발생시킵니다.

(다음에서 상속됨 Installer)
OnCommitting(IDictionary)

Committing 이벤트를 발생시킵니다.

(다음에서 상속됨 Installer)
Rollback(IDictionary)

컴퓨터를 설치 전 상태로 복원합니다.

ToString()

Component의 이름이 포함된 String을 반환합니다(있는 경우). 이 메서드는 재정의할 수 없습니다.

(다음에서 상속됨 Component)
Uninstall(IDictionary)

설치를 제거합니다.

이벤트

AfterInstall

Installers 속성의 모든 설치 관리자에 대한 Install(IDictionary) 메서드가 실행된 후에 발생합니다.

(다음에서 상속됨 Installer)
AfterRollback

Installers 속성의 모든 설치 관리자에 대한 설치가 롤백된 후에 발생합니다.

(다음에서 상속됨 Installer)
AfterUninstall

Installers 속성의 모든 설치 관리자가 제거 작업을 수행한 후에 발생합니다.

(다음에서 상속됨 Installer)
BeforeInstall

설치 관리자 컬렉션에 있는 각 설치 관리자의 Install(IDictionary) 메서드가 실행되기 전에 발생합니다.

(다음에서 상속됨 Installer)
BeforeRollback

Installers 속성의 설치 관리자가 롤백되기 전에 발생합니다.

(다음에서 상속됨 Installer)
BeforeUninstall

Installers 속성의 설치 관리자가 제거 작업을 수행하기 전에 발생합니다.

(다음에서 상속됨 Installer)
Committed

Installers 속성의 모든 설치 관리자가 설치를 커밋한 후에 발생합니다.

(다음에서 상속됨 Installer)
Committing

Installers 속성의 설치 관리자가 설치를 커밋하기 전에 발생합니다.

(다음에서 상속됨 Installer)
Disposed

Dispose() 메서드를 호출하여 구성 요소를 삭제할 때 발생합니다.

(다음에서 상속됨 Component)

적용 대상