View Javadoc
1   /*
2    * Copyright 2009-2010 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.springframework.batch.admin.jmx;
17  
18  import java.util.Date;
19  
20  import org.springframework.jmx.export.annotation.ManagedAttribute;
21  import org.springframework.jmx.export.annotation.ManagedMetric;
22  import org.springframework.jmx.support.MetricType;
23  
24  /**
25   * @author Dave Syer
26   *
27   */
28  public interface JobExecutionMetrics {
29  
30  	@ManagedMetric(metricType = MetricType.COUNTER, description = "Job Execution Count")
31  	int getExecutionCount();
32  
33  	@ManagedMetric(metricType = MetricType.COUNTER, description = "Job Execution Failure Count")
34  	int getFailureCount();
35  
36  	@ManagedMetric(metricType = MetricType.GAUGE, description = "Latest Duration Milliseconds")
37  	double getLatestDuration();
38  
39  	@ManagedMetric(metricType = MetricType.GAUGE, description = "Mean Duration Milliseconds")
40  	double getMeanDuration();
41  
42  	@ManagedMetric(metricType = MetricType.GAUGE, description = "Max Duration Milliseconds")
43  	double getMaxDuration();
44  
45  	@ManagedAttribute(description = "Latest Job Execution ID")
46  	long getLatestExecutionId();
47  
48  	@ManagedAttribute(description = "Latest Start Time")
49  	Date getLatestStartTime();
50  
51  	@ManagedAttribute(description = "Latest End Time")
52  	Date getLatestEndTime();
53  
54  	@ManagedAttribute(description = "Latest Exit Code")
55  	String getLatestExitCode();
56  
57  	@ManagedAttribute(description = "Latest Status")
58  	String getLatestStatus();
59  
60  	@ManagedAttribute(description = "Latest Step Execution Exit Description")
61  	String getLatestStepExitDescription();
62  
63  	@ManagedAttribute(description = "Latest Step Execution Step Name")
64  	String getLatestStepName();
65  
66  	@ManagedAttribute(description = "Check if there is a Running Job Execution")
67  	boolean isJobRunning();
68  
69  }