WebProcessStatistics.FormatToString(WebEventFormatter) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
프로세스 통계의 형식을 지정합니다.
public:
virtual void FormatToString(System::Web::Management::WebEventFormatter ^ formatter);
public virtual void FormatToString(System.Web.Management.WebEventFormatter formatter);
abstract member FormatToString : System.Web.Management.WebEventFormatter -> unit
override this.FormatToString : System.Web.Management.WebEventFormatter -> unit
Public Overridable Sub FormatToString (formatter As WebEventFormatter)
매개 변수
- formatter
- WebEventFormatter
WebEventFormatter 웹 상태 이벤트 정보의 서식을 지정하는 데 사용되는 탭 및 들여쓰기 설정이 들어 있는 항목입니다.
예제
다음 코드 예제에서는 사용자 지정 정보의 서식을 지정하는 방법을 보여줍니다.
//Formats Web request event information.
public override void FormatCustomEventDetails(
WebEventFormatter formatter)
{
base.FormatCustomEventDetails(formatter);
// Add custom data.
formatter.AppendLine("");
formatter.AppendLine(
"Custom Process Statistics:");
formatter.IndentationLevel += 1;
// Get the process statistics.
formatter.AppendLine(GetAppDomainCount());
formatter.AppendLine(GetManagedHeapSize());
formatter.AppendLine(GetPeakWorkingSet());
formatter.AppendLine(GetProcessStartTime());
formatter.AppendLine(GetRequestsExecuting());
formatter.AppendLine(GetRequestsQueued());
formatter.AppendLine(GetRequestsRejected());
formatter.AppendLine(GetThreadCount());
formatter.AppendLine(GetWorkingSet());
formatter.IndentationLevel -= 1;
formatter.AppendLine(eventInfo.ToString());
}
'Formats Web request event information.
Public Overrides Sub FormatCustomEventDetails( _
ByVal formatter As WebEventFormatter)
MyBase.FormatCustomEventDetails(formatter)
' Add custom data.
formatter.AppendLine("")
formatter.AppendLine("Custom Process Statistics:")
formatter.IndentationLevel += 1
' Get the process statistics.
formatter.AppendLine(GetAppDomainCount())
formatter.AppendLine(GetManagedHeapSize())
formatter.AppendLine(GetPeakWorkingSet())
formatter.AppendLine(GetProcessStartTime())
formatter.AppendLine(GetRequestsExecuting())
formatter.AppendLine(GetRequestsQueued())
formatter.AppendLine(GetRequestsRejected())
formatter.AppendLine(GetThreadCount())
formatter.AppendLine(GetWorkingSet())
formatter.IndentationLevel -= 1
formatter.AppendLine(eventInfo.ToString())
End Sub
End Class
설명
이 메서드는 FormatToString 이벤트 정보에 대한 균일한 형식을 제공합니다. 이 형식은 이벤트 데이터를 기록해야 하고 나중에 사용자에게 제공해야 하는 경우에 유용합니다. 공급자가 메서드 중 ToString 하나를 호출할 때 내부적으로 호출됩니다.