共用方式為


監視工作流程效能

您可以在 Windows XP 上使用 [效能] (Perfmon.exe) 或在 Windows Vista 上使用 [可靠性和效能監視器] (Perfmon.exe) 工具來監控工作流程效能。 透過使用這些工具,您可以將效能計數器設定為記錄效能資料,並設定系統警示當指定的計數器值高於或低於定義臨界值時會通知您。

Windows Workflow Foundation 提供一組效能計數器與 Windows Workflow Foundation 效能物件,您可使用這個物件來追蹤工作流程執行階段在執行工作流程執行個體時的效能。 如需效能計數器的完整清單,請參閱Workflow Performance Counters

Windows Workflow Foundation 效能計數器預設為啟用。 因為當工作流程引擎啟動以及工作流程執行個體執行時,它們會對效能帶來負面影響,所以您可以停用計數器,方法是在工作流程組態檔中將 EnablePerformanceCounters 屬性設為 false,或以程式設計方式在 EnablePerformanceCounters 中變更。

下列範例顯在 App.config 組態檔中新增這個屬性的位置:

<?xml version="1.0"?>
<configuration>
    <configSections>
        <section name="CustomWorkflowRuntimeSettings" type="System.Workflow.Runtime.Configuration.WorkflowRuntimeSection, System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    </configSections>
    <CustomWorkflowRuntimeSettings Name="Workflow1" EnablePerformanceCounters ="false">
        <!-- Define common parameters and declare services required for your workflow runtime -->
    </CustomWorkflowRuntimeSettings>
</configuration>

如需組態檔的詳細資訊,請參閱Workflow Configuration Formats工作 2:使用 App.Config 設定執行階段服務

如需將效能計數器新增至 [效能] 和 [可靠性和效能監視器] 工具的詳細資訊,請參閱 Microsoft TechNet 網站。

請參閱

其他資源

Workflow Performance Counters
Windows Workflow Foundation 程式設計指南

Footer image

Copyright © 2007 by Microsoft Corporation. All rights reserved.