// Duanes Incident Timer Calc
//
// This script is used to create a string field (and metric) that indicates how long an "incident" has been going on, and can display it on a live dashbaord
//
// metrics will appear under the Custom Metric Host, under a tab called "Alert_timer"
//
// When an alert is open, start counting the number of intervals it has been open
//
// When the alert goes away, the script will wait 5 minutes before declaring the "incident" has ended (and resetting the timer)
//
// This ensures that alerts that are "flashing on and off" stay measured by the incident timer
To deploy the script, copy it to the MOM, place it in thwe <Introscope x.x>/scripts folder, and rename it to incident_timer.js
Pro tip: Use the "StringViewer" widget to view the live timer. The it's much easier to get rid of the scollbars, resulting in a cleaner look.