01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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.cocoon.webservices.instrument;
18:
19: import org.apache.avalon.framework.component.Component;
20: import org.apache.excalibur.instrument.InstrumentManageable;
21:
22: /**
23: * Component interface for retrieving sample information from the
24: * InstrumentManager.
25: *
26: * @author <a href="mailto:crafterm@apache.org">Marcus Crafter</a>
27: * @version CVS $Id: InstrumentationService.java 433543 2006-08-22 06:22:54Z crossley $
28: */
29: public interface InstrumentationService extends InstrumentManageable,
30: Component {
31:
32: /**
33: * Component ROLE name
34: */
35: String ROLE = InstrumentationService.class.getName();
36:
37: /**
38: * Obtain an array of samples from a specified sample name.
39: *
40: * <p>
41: * The specified path parameter identifies a sample, hierarchically from
42: * Instrumentable name to Instrument name, to Instrument sample name
43: * (including any child Instrumentables) using the '.' character as a
44: * separator.
45: * </p>
46: *
47: * <pre>
48: * eg: instrument-manager.active-thread-count.maximum_1000_600
49: * </pre>
50: *
51: * <p>
52: * The above example identifies the sample 'maximum_1000_600' on instrument
53: * 'active-thread-count', on instrumentable 'instrument-manager'.
54: * </p>
55: *
56: * <p>
57: * The length of the returned array is dependant on the configuration of the
58: * sample being accessed. Check instrumentation.xconf for the length of pre-
59: * defined samples that operate constantly, when instrumentation is enabled.
60: * </p>
61: *
62: * @param path path value
63: * @return an <code>int[]</code> array of samples
64: * @exception Exception if an error occurs
65: */
66: int[] getSampleSnapshot(String path) throws Exception;
67:
68: /**
69: * Obtains an array of instrumentable sample names
70: *
71: * @return a {@link String}[] array of sample names
72: */
73: String[] getSampleNames();
74: }
|