Export (0) Print
Expand All

Lesson 4: Monitoring the Health of the HRApplicationServices Application

Objective: To learn how to perform monitoring by using Microsoft AppFabric 1.1 for Windows Server.

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.

Prerequisites

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

  1. Open Internet Explorer.

  2. In the address box copy or paste the name of the application’s name preceded by http://localhost/. By default, it will be:

    http://localhost/HRApplicationServices/
    

    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.

    Online Job Application
  3. 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.

  4. 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.

    Online Application Response
  5. Open the <drive>:\mailbox directory on the computer.

  6. 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.)

  7. 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.

  8. 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.)

    Review the Application Screenshot
    ImportantImportant
    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

  1. Start or switch to the IIS Manager window.

  2. 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.

    TipTip
    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.

  3. Double-click AppFabric Dashboard in the AppFabric section. The dashboard resembles the graphic below.

    AppFabric Dashboard

    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.

  4. 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.

    Persisted or Idle Instances
  5. 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.

    Running Or Idle Deatail
  6. 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.

    cdc0b277-27a6-4ed7-8ceb-d37c82c4aaf4
  7. Select the instance and note the Actions section.

    Actions Section

    You can suspend, cancel, terminate or delete the instance at this point.

  8. Click View Tracked WF Events. The dashboard displays the individual events associated with the instance.

    Tracked Events

    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.

  9. Press ALT and the “back” arrow to return to the main view of the dashboard. Or right-click the dashboard and click AppFabric Dashboard.

  10. 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.

  11. Look at the WF Instance History group. This section shows the count of the tracked workflow instances, grouped by the instance activity.

     

    Counter Note

    Activations

    An instance is counted in the Activations section if it has been activated in the past 24 hours.

    Failures

    An instance is counted in the Failures section if it has experienced a failure in the past 24 hours.

    Completions

    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.

    TipTip
    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.

    ImportantImportant
    Leave IIS Manager as it is (do not close it). You will return to this screen later.

To complete the workflow

  1. 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.

  2. Open the <drive>:\mailbox folder on the computer.

  3. Open the message corresponding to the time when you clicked the “Hire” button.

    The final message congratulates the applicant.

  4. Return to IIS Manager.

  5. Right-click the AppFabric dashboard and click Refresh.

  6. 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.

Next Steps

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.

See Also

  2012-09-12
Show:
© 2015 Microsoft