001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.camel.api.management.mbean;
018
019import java.util.Date;
020import java.util.Map;
021
022import org.apache.camel.api.management.ManagedAttribute;
023import org.apache.camel.api.management.ManagedOperation;
024
025public interface ManagedPerformanceCounterMBean extends ManagedCounterMBean {
026
027    @ManagedAttribute(description = "Number of completed exchanges")
028    long getExchangesCompleted();
029
030    @ManagedAttribute(description = "Number of failed exchanges")
031    long getExchangesFailed();
032
033    @ManagedAttribute(description = "Number of inflight exchanges")
034    long getExchangesInflight();
035
036    @ManagedAttribute(description = "Number of failures handled")
037    long getFailuresHandled();
038
039    @ManagedAttribute(description = "Number of redeliveries (internal only)")
040    long getRedeliveries();
041
042    @ManagedAttribute(description = "Number of external initiated redeliveries (such as from JMS broker)")
043    long getExternalRedeliveries();
044
045    @ManagedAttribute(description = "Min Processing Time [milliseconds]")
046    long getMinProcessingTime();
047
048    @ManagedAttribute(description = "Mean Processing Time [milliseconds]")
049    long getMeanProcessingTime();
050
051    @ManagedAttribute(description = "Max Processing Time [milliseconds]")
052    long getMaxProcessingTime();
053
054    @ManagedAttribute(description = "Total Processing Time [milliseconds]")
055    long getTotalProcessingTime();
056
057    @ManagedAttribute(description = "Last Processing Time [milliseconds]")
058    long getLastProcessingTime();
059
060    @ManagedAttribute(description = "Delta Processing Time [milliseconds]")
061    long getDeltaProcessingTime();
062
063    @ManagedAttribute(description = "Time in millis being idle (no messages incoming or inflight)")
064    long getIdleSince();
065
066    @ManagedAttribute(description = "Last Exchange Created Timestamp")
067    Date getLastExchangeCreatedTimestamp();
068
069    @ManagedAttribute(description = "Last Exchange Completed Timestamp")
070    Date getLastExchangeCompletedTimestamp();
071
072    @ManagedAttribute(description = "Last Exchange Completed ExchangeId")
073    String getLastExchangeCompletedExchangeId();
074
075    @ManagedAttribute(description = "First Exchange Completed Timestamp")
076    Date getFirstExchangeCompletedTimestamp();
077
078    @ManagedAttribute(description = "First Exchange Completed ExchangeId")
079    String getFirstExchangeCompletedExchangeId();
080
081    @ManagedAttribute(description = "Last Exchange Failed Timestamp")
082    Date getLastExchangeFailureTimestamp();
083
084    @ManagedAttribute(description = "Last Exchange Failed ExchangeId")
085    String getLastExchangeFailureExchangeId();
086
087    @ManagedAttribute(description = "First Exchange Failed Timestamp")
088    Date getFirstExchangeFailureTimestamp();
089
090    @ManagedAttribute(description = "First Exchange Failed ExchangeId")
091    String getFirstExchangeFailureExchangeId();
092
093    @ManagedAttribute(description = "Statistics enabled")
094    boolean isStatisticsEnabled();
095
096    @ManagedAttribute(description = "Statistics enabled")
097    void setStatisticsEnabled(boolean statisticsEnabled);
098
099    @ManagedOperation(description = "Dumps the statistics as XML")
100    String dumpStatsAsXml(boolean fullStats);
101
102    @ManagedOperation(description = "Dumps the statistics as JSon")
103    String dumpStatsAsJSon(boolean fullStats);
104
105    @ManagedOperation(description = "Adds statistics to the Map")
106    void statsAsJSon(Map<String, Object> json, boolean fullStats);
107
108}