Configuration‎ > ‎

Heartbeat Scheduling

posted Oct 4, 2011, 10:28 AM by Greg Kent   [ updated Oct 4, 2011, 11:03 AM by Eric Patrick ]
Overview
Scheduling has been implemented at the individual heartbeat level. This will allow heartbeat execution times to be custom tailored to a schedule that best fits the given heartbeat type and application. The end goal is to check various heartbeats only when deemed appropriate thus reducing the amount of "false positives" generated which dilutes the value of heartbeat. This enables the application owner(s) to define schedules to control when heartbeats should monitor their application.

Use Cases
  • Use Case 1 - File System Heartbeat - By nature this heartbeat can be checked frequently as it's not resource intensive and always available. Consider the configuration:
    • Schedule - 'Main Schedule' - indicates the most coverage
    • Omitting Schedule - this would run every time support invokes heartbeat
  • Use Case 2 - Database Health Status - This heartbeat should be execute less frequently (Eg. twice a day and not during maintenance)
    • Schedule - 'DB Schedule' - indicates a custom schedule that only allows twice a day and omits Saturday
  • Use Case 3 - Custom Stored Procedure Implementation (eg. Agent Acceptance Alerts) - This heartbeat should be execute less frequently (Eg. once a day)
    • Schedule - 'Once a day at 9:00a'
    • This is the same scheduling as Event Service whereas schedule provisions and schedule exclusions can be defined
  • Use Case 4 - Unanticipated Scheduled Maintenance on FTP File Store for dates December 4, 5, 9 at 9:00p PDT
    • The scheduling DOES NOT support ad-hoc maintenance based on specific days of the month. It's only intended for scheduled uptime and downtime on a weekly basis. It would be best to disable heartbeat manually during these downtimes.
Implementation

The Heartbeat assembly node now has an optional tag Schedule:

      <HeartbeatAssembly>
        <Label>File System Health Status</Label>
        <Name>FileSystemHealthObject</Name>
        <!--Schedule is optional. If a schedule is specified hearbeat will enforce scheduling. If unspecified, heartbeat will execute-->
        <Schedule>Main Schedule</Schedule>
        <NameSpace>qbo.Heartbeat.Plugins</NameSpace>
        <AssemblyFile>d:\websites\services.quandis.com\bin\qbo.Heartbeat.Plugins.dll</AssemblyFile>
        <CacheDuration>5</CacheDuration>
      </HeartbeatAssembly>

If specified, this heartbeat will only execute if scheduling conditions are met. Within Heartbeat.config, a Schedules section can be added with multiple schedules. The heartbeat Schedule value must match the EventSchedule value for the schedules to bind:

 <Schedules>
      <EventScheduleObject>
        <EventSchedule>Main Schedule</EventSchedule>
        <!--
Use Provisions to specify run dates and times. If there is a requirement to exclude a time frame in a given
        day, use the Exclusions to block out that timeframe.
-->
        <Provisions>
          <ScheduleProvision>
            <DayOfWeek>Monday</DayOfWeek>
            <StartTime>00:00:00</StartTime>
            <EndTime>23:59:59</EndTime>
          </ScheduleProvision>
          <ScheduleProvision>
            <DayOfWeek>Tuesday</DayOfWeek>
            <StartTime>05:00:00</StartTime>
            <EndTime>20:00:00</EndTime>
          </ScheduleProvision>
          <ScheduleProvision>
            <DayOfWeek>Wednesday</DayOfWeek>
            <StartTime>05:00:00</StartTime>
            <EndTime>20:00:00</EndTime>
          </ScheduleProvision>
          <ScheduleProvision>
            <DayOfWeek>Thursday</DayOfWeek>
            <StartTime>05:00:00</StartTime>
            <EndTime>20:00:00</EndTime>
          </ScheduleProvision>
          <ScheduleProvision>
            <DayOfWeek>Friday</DayOfWeek>
            <StartTime>05:00:00</StartTime>
            <EndTime>20:00:00</EndTime>
          </ScheduleProvision>
          <ScheduleProvision>
            <DayOfWeek>Saturday</DayOfWeek>
            <StartTime>05:00:00</StartTime>
            <EndTime>20:00:00</EndTime>
          </ScheduleProvision>
          <ScheduleProvision>
            <DayOfWeek>Sunday</DayOfWeek>
            <StartTime>05:00:00</StartTime>
            <EndTime>20:00:00</EndTime>
          </ScheduleProvision>
        </Provisions>
        <Exclusions>
          <!--
Multiple schedule exclusions can be added to a given day. It's assumed the Provision
covers the entire run time spectrum. If one of the Exclusions are matched, the schedule will not run
-->
          <ScheduleExclusion>
            <DayOfWeek>Monday</DayOfWeek>
            <StartTime>00:30:00</StartTime>
            <EndTime>03:00:00</EndTime>
          </ScheduleExclusion>
        </Exclusions>
      </EventScheduleObject>
    </Schedules>

The Schedule node can be omitted from the HeartbeatAssembly node for reverse compatibility. The heartbeat will always execute when the service is invoked by support.

Note this functionality is different from the CacheDuration. CacheDuration allows caching of a heartbeat result during an allowed execution time.

 
Comments