In this section we will discuss how to use Watches and SLAs. If you want to skip ahead to sub topics, the links follow directly. The remainder of this page touches on the basics and fundamentals of Watches and SLAs.
The Rio Watch framework provides mechanisms to collect and analyze programmer defined metrics defined in a distributed application. This framework may be used to instrument services developed under the Rio Architecture and to monitor performance and other measurable aspects of distributed operational strings of execution using this architecture.
The approach outlined in this document provides the basis for recording a measurement of a metric. Recording can be done either locally within a JVM or remotely across different JVM's. Depending on the type of metric being observed (watched), the type of watch differs:
Each of these watches extend from ThresholdWatch, which contains ThresholdValues, which in turn can have SLAs attached to them providing specific SLAPolicyHandlers approaches
Watches record Calculable objects that contain the value of the metric being observed and the time when the metric was captured. These objects are stored in a WatchDataSource. The WatchDataSource can be transient or persistent, and provides a repository for given watch instance Calculables.
While the Watch framework is generic in that it can collect any kind of metric, a common use will be to measure application response times. It is useful to analyze this type of measurement to understand the Watchable Framework.
Using the policy mechanisms available in Rio, services can have SLAs attached to them, ensuring operational criteria is met. The dynamic service's operational behavior can be monitored and dynamically scale it's environment up & down based on declarative attributes. Generically speaking, we think of these as Behavioral Policies.

Rio provides support to observe and watch system and application defined metrics. The approach is based on a sensor-effector pattern. Data is observed from applications, OS, hardware, etc ... and measured against declared thresholds.
Policy enforcement can happen locally, distributed or hierarchically. Policy enforcement is handled by SLA Policy Handlers. SLA Policy Handlers provide if-then-else logic required to deal with the problem set they know about, are associated to Watches, and are notified of out-of-bound conditions. Rio provides three different SLA Policy Handlers: