[SAGA-RG] [Saga-devel] Is a metric also an attribute?

Hartmut Kaiser hkaiser at cct.lsu.edu
Mon Apr 28 07:36:03 CDT 2008


Malcolm,

> Havent seen any traffic on the email list for a while, so emailing you
> directly in case it has broken again ...
> 
> In the specification for jobs, there are two definitions for job state:
> 
> /** Metric name, fires on state changes of the job. */
> public static final String JOB_STATE = "job.state";
> // Optional metrics:
> /** Metric name, fires as a job changes its state detail. */
> public static final String JOB_STATEDETAIL = "job.state_detail";
> 
> Now, if something is defined as a metric, does this mean it is also
> available as an attribute? The definition for metrics states that they
> are
> for monitoring changes to the value, however in my case I simply want
> to get
> the current value rather than monitoring it. Am I missing something
> here?

The metric object exposes the attribute interface. Further, the metric uses
a specific attribute to store its value (I think the name of this attribute
was "metric.value"). 

In your example above the job exposes two attributes: job.state and
job.state_detail, which are additionally available for monitoring (i.e. fire
a metric if something is registered with them). 

So the answer to your question is, that you simply can ask the job for its
attributes to get the current job state, no need to register a callback
function here.

HTH
Regards Hartmut





More information about the saga-rg mailing list