View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *     http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.commons.pipeline.stage;
18  
19  /**
20   * Interface to JMX enable the ExtendedBaseStage.
21   * 
22   * @author mzsanford
23   */
24  public interface ExtendedBaseStageMBean {
25  	/**
26  	 * @return build the status message. This may have an effect on stage throughput.
27  	 */
28  	public abstract String getStatusMessage();
29  
30  	/**
31  	 * @return number of records after which status messages are logged.
32  	 */
33  	public abstract Long getStatusInterval();
34  
35  	/**
36  	 * @param statusInterval new status interval
37  	 */
38  	public abstract void setStatusInterval(Long statusInterval);
39  
40  	/**
41  	 * @return Size of batches processes by this stage (used to adjust throughput statistics)
42  	 */
43  	public Integer getStatusBatchSize();
44  
45  	/**
46  	 * @param statusBatchSize Size of batches processes by this stage (used to adjust throughput statistics)
47  	 */
48  	public void setStatusBatchSize(Integer statusBatchSize);
49  	
50  	/**
51  	 * @return number of objects received
52  	 */
53  	public abstract long getObjectsReceived();
54  
55  	/**
56  	 * @return total number of milliseconds spent processing
57  	 */
58  	public abstract long getTotalServiceTime();
59  
60  	/**
61  	 * @return total number of milliseconds spent blocked on downstream queues
62  	 */
63  	public abstract long getTotalEmitTime();
64  
65  	/**
66  	 * @return total number of emits to downstream queues
67  	 */
68  	public abstract long getTotalEmits();
69  
70  	/**
71  	 * @return true is this stage is collecting branch stats, false otherwise.
72  	 */
73  	public abstract Boolean getCollectBranchStats();
74  
75  	/**
76  	 * Branch stats are disabled by default because they are slow. Turning this on
77  	 * can have a noticeable effect on stage throughput.
78  	 * 
79  	 * @param collectBranchStats true if this stage should start collecting branch stats,
80  	 *  false otherwise.
81  	 */
82  	public abstract void setCollectBranchStats(Boolean collectBranchStats);
83  	
84  	/**
85  	 * Get the current average service time. This works by looking only at the last
86  	 * X objects processed, where X is defined and reported by the getCurrentStatWindowSize
87  	 *  and  setCurrentStatWindowSize methods.
88  	 *
89  	 * @return average time to process in milliseconds
90  	 */
91  	public double getCurrentServiceTimeAverage();
92  	
93  	/**
94  	 * Get the size of the service time collection window
95  	 */
96  	public Integer getCurrentStatWindowSize();
97  	
98  	/**
99  	 * Set the size of the service time collection window
100 	 */
101 	public void setCurrentStatWindowSize(Integer newStatWindowSize);
102 
103 }