GridLab
Grid Application Toolkit

A simple API for Grid Applications
GAT

Menu



Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members  

MetricEvent.java

Go to the documentation of this file.
00001 package org.gridlab.gat.monitoring;
00002 
00003 import java.util.EventObject;
00004 
00005 /**
00006  * An instance of this class represents an metric event.
00007  * <p>
00008  * A metric event occurs whenever the monitored resource, be it a job or a hardware 
00009  * resource, sends out an event to the monitoring system. This can encompass almost 
00010  * any type of event from disk space running out to memory becoming  available. The 
00011  * various events are defined by the various sensors. This topic is covered in more 
00012  * detail in the Metric documentation.
00013  */
00014 public class MetricEvent extends EventObject {
00015    /**
00016     * This member variable holds the event time of this MetricEvent
00017     */
00018     private long eventTime = 0;
00019     
00020    /**
00021     * This member variable holds the value of this MetricEvent
00022     */
00023     private Object value = null;
00024    
00025    /**
00026     * This member variable holds the metric of this MetricEvent
00027     */
00028     private Metric metric = null;
00029                       
00030    /**
00031     * Constructs a MetricEvent with the specified properties
00032     *
00033     * @param source The source of the MetricEvent
00034     * @param value The value of the MetricEvent
00035     * @param metric The Metric of the MetricEvent
00036     * @param eventTime The number of milliseconds after January 1, 1970, 00:00:00 GMT 
00037     * when the MetricEvent happened.
00038     */
00039     public MetricEvent(Object source, Object value, Metric metric, long eventTime) {
00040         super( source );
00041         
00042         this.value = value;
00043         this.metric = metric;
00044         this.eventTime = eventTime;
00045     }
00046     
00047    /**
00048     * This method returns an instance of the Metric to which this MetricEvent 
00049     * corresponds.  
00050     *
00051     * @return A Metric corresponding to this MetricEvent
00052     */
00053     public Metric getMetric() {
00054         return metric;
00055     }
00056     
00057    /**
00058     * This method returns the value corresponding to this MetricEvent.
00059     *
00060     * @return An Object which is the value of this MetricEvent.
00061     */
00062     public Object getValue() {
00063         return value;
00064     } 
00065     
00066    /**
00067     * This method returns the number of milliseconds after January 1, 1970, 
00068     * 00:00:00 GMT when the event happened. 
00069     *
00070     * @return A long, the number of milliseconds after January 1, 1970, 
00071     * 00:00:00 GMT when the event happened.
00072     */
00073     public long getEventTime() {
00074         return eventTime;
00075     }
00076 }