1 package fr.in2p3.jsaga.impl.job.instance;
2
3 import fr.in2p3.jsaga.adaptor.job.SubState;
4 import fr.in2p3.jsaga.impl.monitoring.*;
5 import fr.in2p3.jsaga.impl.task.TaskStateMetricFactoryImpl;
6 import org.ogf.saga.error.NotImplementedException;
7 import org.ogf.saga.job.Job;
8 import org.ogf.saga.task.State;
9
10
11
12
13
14
15
16
17
18
19
20
21
22 public class JobMetrics {
23 MetricImpl<State> m_State;
24 MetricImpl<String> m_StateDetail;
25
26
27 JobMetrics(AbstractSyncJobImpl job) throws NotImplementedException {
28 m_State = new TaskStateMetricFactoryImpl<State>(job).createAndRegister(
29 Job.JOB_STATE,
30 "fires on state changes of the job, and has the literal value of the job state enum.",
31 MetricMode.ReadOnly,
32 "1",
33 MetricType.Enum,
34 State.NEW);
35 m_StateDetail = new TaskStateMetricFactoryImpl<String>(job).createAndRegister(
36 Job.JOB_STATEDETAIL,
37 "fires as a job changes its state detail",
38 MetricMode.ReadOnly,
39 "1",
40 MetricType.String,
41 "Unknown:Unknown");
42 }
43
44
45 public JobMetrics clone() throws CloneNotSupportedException {
46 JobMetrics clone = (JobMetrics) super.clone();
47 clone.m_State = m_State.clone();
48 clone.m_StateDetail = m_StateDetail.clone();
49 return clone;
50 }
51 }