Lesson 4: Monitoring the Health of the HRApplicationServices Application
Objective: To learn how to perform monitoring by using Windows Server AppFabric.
Purpose: AppFabric provides you with new options and tools for monitoring and troubleshooting the health of your deployed applications that include WCF and/or WF services. The monitoring features support centralized event collection. In this lesson, you run a workflow instance. Then you use AppFabric to monitor the workflow instance and the tracked Windows Communication Foundation (WCF) and Windows Workflow Foundation (WF) events.
Deploy the HRApplicationServices workflow application. For more information, see Lesson 2: Deploying the HRApplicationServices Workflow Service.
Enable AppFabric monitoring and persistence. For more information, see Lesson 3: Configuring the HRApplicationServices Application.
Running the Application
To demonstrate AppFabric you must run a workflow or web service application to monitor and track. The prerequistite to this lesson is to build and deploy the HRApplicationServices workflow application on IIS. Once properly deployed, you can run the simple workflow and generate the events to monitor and track.
To run the HRApplicationServices workflow
Open Internet Explorer.
In the address box copy or paste the name of the application’s name preceded by
http://localhost/. By default, it will be:
You will see the application form for the Contoso company which resembles the graphic below. It includes fields for name, email address, and education level.
Click the Education box and select Masters from the drop-down list. Since the application does not actually send email, you need not change the default values.
Click the Apply button.
The application has been made and the workflow has begun to execute. You are then presented with the “Thank you” message that resembles the graphic below. Note the “applicant ID” value, which is created by the application when storing the application.
Open the <drive>:\mailbox directory on the computer.
Double-click the mail message file in the folder to read it. (If you do not have a mail program that can open the file, open it with Notepad.exe) If you have already run the application and generated several email files, select the one the matches the date and time of your application.)
The message is for a reviewer and requests that the applicant receive a screening by the mail recipient. The message includes a link (“Review the application”) to click.
In the email, click Review the application.
A new page appears in Internet Explorer that resembles the graphic below. Do not click anything yet! Because the workflow is waiting for human interaction, it is in an idle state. We will view that idle instance in the next section. If you have clicked on either Hire or No Hire you repeat the application process; just be sure to set the education level to either Masters or Doctorate (Bachelors and None are automatically rejected.)
Important Keep this page and Internet Explorer open. You will return to it after viewing the AppFabric dashboard in the next section.
Using the Dashboard
The Dashboard lets you view selected metrics from the monitoring store and persistence information from the persistence store. The IIS Manager extensions in AppFabric allow you to manage monitoring stores, set the monitoring level, and query and analyze tracked events.
To use the dashboard
Start or switch to the IIS Manager window.
Expand the server node, expand Sites, and then click HRApplicationServices to select it. The application you select sets the scope of the AppFabric reporting. That is, the dashboard will display only data related to that selected node.
Tip If you want to expand the scope click the Default Web Site to select it. When you click AppFabric Dashboard, data from all applications under the default site will be returned.
Double-click AppFabric Dashboard in the AppFabric section. The dashboard resembles the graphic below.
The dashboard consists of three main sections. Each is explored briefly in the rest of this tutorial. For more information, see Windows Server AppFabric Dashboard Page.
Examine the Persisted WF Instances section. This section shows the count of persisted workflow instances grouped by their status. There should be one instance in the section, similar to the graphic below.
Double click SubmitApplication.xamlx. The dashboard will change to the Persisted WF Instances view, and displays the instance. Note that the Status of the instance is set to “Running(Idle)” which indicates that the workflow is not yet complete. For more information see Persisted WF Instances Page.
Also note the Query Summary and its detail section. In a production setting with hundreds of instances running, you can use the query to filter out extraneous data.
Select the instance and note the Actions section.
You can suspend, cancel, terminate or delete the instance at this point.
Click View Tracked WF Events. The dashboard displays the individual events associated with the instance.
You can see the details for any event by clicking on it. The details section also includes a Tracked Variables and Errors tab. For more information see Tracked Events Page.
Press ALT and the “back” arrow to return to the main view of the dashboard. Or right-click the dashboard and click AppFabric Dashboard.
Look at the WCF Call History group. This section shows the count of WCF calls received in the past 24 hours, grouped by the status of the call.
Look at the WF Instance History group. This section shows the count of the tracked workflow instances, grouped by the instance activity.
An instance is counted in the Activations section if it has been activated in the past 24 hours.
An instance is counted in the Failures section if it has experienced a failure in the past 24 hours.
An instance is counted in the Completions section if it has completed in the past 24 hours.
Because you have not yet encountered an error all counts should be zero.
Tip The Dashboard shows the WCF call and Tracked WF Instance activity in the past 24 hours by default. The length of this time period is controlled by the Time Period drop-down list at the top of the Dashboard. Important Leave IIS Manager as it is (do not close it). You will return to this screen later.
To complete the workflow
Switch back to Internet Explorer and in the Job Applicant Approval web page, click Hire. The workflow is out of the idle state and completed.
Open the <drive>:\mailbox folder on the computer.
Open the message corresponding to the time when you clicked the “Hire” button.
The final message congratulates the applicant.
Return to IIS Manager.
Right-click the AppFabric dashboard and click Refresh.
You can now examine the dashboard for changes. In particular, note the presence of the completed workflow. Double-click the instance to see more details about it.
What Did I Just Do?
In this lesson, you ran the HRApplicationServices application and completed the workflow. You also used AppFabric to examine the idle workflow instance and its tracked events.
In Lesson 5: Resuming a Suspended Workflow Using AppFabric, you will disrupt the workflow to create a suspended instance. You will then fix the application and resume the workflow using the AppFabric interface.