Class ComponentStatsManager
- java.lang.Object
-
- org.apache.pulsar.functions.instance.stats.ComponentStatsManager
-
- All Implemented Interfaces:
java.lang.AutoCloseable
- Direct Known Subclasses:
FunctionStatsManager,SinkStatsManager,SourceStatsManager
public abstract class ComponentStatsManager extends java.lang.Object implements java.lang.AutoCloseable
-
-
Field Summary
Fields Modifier and Type Field Description protected FunctionCollectorRegistrycollectorRegistryprotected com.google.common.collect.EvictingQueueEMPTY_QUEUEprotected static java.lang.String[]exceptionMetricsLabelNamesstatic java.lang.String[]metricsLabelNamesprotected java.lang.String[]metricsLabelsprotected java.util.concurrent.ScheduledFuture<?>scheduledFuturestatic java.lang.StringUSER_METRIC_PREFIX
-
Constructor Summary
Constructors Constructor Description ComponentStatsManager(FunctionCollectorRegistry collectorRegistry, java.lang.String[] metricsLabels, java.util.concurrent.ScheduledExecutorService scheduledExecutorService)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()abstract doublegetAvgProcessLatency()abstract doublegetAvgProcessLatency1min()protected org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatus.ExceptionInformationgetExceptionInfo(java.lang.Throwable th, long ts)abstract doublegetLastInvocation()abstract com.google.common.collect.EvictingQueue<org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatus.ExceptionInformation>getLatestSinkExceptions()abstract com.google.common.collect.EvictingQueue<org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatus.ExceptionInformation>getLatestSourceExceptions()abstract com.google.common.collect.EvictingQueue<org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatus.ExceptionInformation>getLatestSystemExceptions()abstract com.google.common.collect.EvictingQueue<org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatus.ExceptionInformation>getLatestUserExceptions()java.lang.StringgetStatsAsString()static ComponentStatsManagergetStatsManager(FunctionCollectorRegistry collectorRegistry, java.lang.String[] metricsLabels, java.util.concurrent.ScheduledExecutorService scheduledExecutorService, org.apache.pulsar.functions.proto.Function.FunctionDetails.ComponentType componentType)abstract doublegetTotalProcessedSuccessfully()abstract doublegetTotalProcessedSuccessfully1min()abstract doublegetTotalRecordsReceived()abstract doublegetTotalRecordsReceived1min()abstract doublegetTotalSysExceptions()abstract doublegetTotalSysExceptions1min()abstract doublegetTotalUserExceptions()abstract doublegetTotalUserExceptions1min()abstract voidincrSinkExceptions(java.lang.Throwable userException)abstract voidincrSourceExceptions(java.lang.Throwable userException)abstract voidincrSysExceptions(java.lang.Throwable sysException)abstract voidincrTotalProcessedSuccessfully()abstract voidincrTotalReceived()abstract voidincrUserExceptions(java.lang.Throwable userException)abstract voidprocessTimeEnd()abstract voidprocessTimeStart()abstract voidreset()abstract voidsetLastInvocation(long ts)
-
-
-
Field Detail
-
metricsLabels
protected java.lang.String[] metricsLabels
-
scheduledFuture
protected java.util.concurrent.ScheduledFuture<?> scheduledFuture
-
collectorRegistry
protected final FunctionCollectorRegistry collectorRegistry
-
EMPTY_QUEUE
protected final com.google.common.collect.EvictingQueue EMPTY_QUEUE
-
USER_METRIC_PREFIX
public static final java.lang.String USER_METRIC_PREFIX
- See Also:
- Constant Field Values
-
metricsLabelNames
public static final java.lang.String[] metricsLabelNames
-
exceptionMetricsLabelNames
protected static final java.lang.String[] exceptionMetricsLabelNames
-
-
Constructor Detail
-
ComponentStatsManager
public ComponentStatsManager(FunctionCollectorRegistry collectorRegistry, java.lang.String[] metricsLabels, java.util.concurrent.ScheduledExecutorService scheduledExecutorService)
-
-
Method Detail
-
getStatsManager
public static ComponentStatsManager getStatsManager(FunctionCollectorRegistry collectorRegistry, java.lang.String[] metricsLabels, java.util.concurrent.ScheduledExecutorService scheduledExecutorService, org.apache.pulsar.functions.proto.Function.FunctionDetails.ComponentType componentType)
-
reset
public abstract void reset()
-
incrTotalReceived
public abstract void incrTotalReceived()
-
incrTotalProcessedSuccessfully
public abstract void incrTotalProcessedSuccessfully()
-
incrSysExceptions
public abstract void incrSysExceptions(java.lang.Throwable sysException)
-
incrUserExceptions
public abstract void incrUserExceptions(java.lang.Throwable userException)
-
incrSourceExceptions
public abstract void incrSourceExceptions(java.lang.Throwable userException)
-
incrSinkExceptions
public abstract void incrSinkExceptions(java.lang.Throwable userException)
-
setLastInvocation
public abstract void setLastInvocation(long ts)
-
processTimeStart
public abstract void processTimeStart()
-
processTimeEnd
public abstract void processTimeEnd()
-
getTotalProcessedSuccessfully
public abstract double getTotalProcessedSuccessfully()
-
getTotalRecordsReceived
public abstract double getTotalRecordsReceived()
-
getTotalSysExceptions
public abstract double getTotalSysExceptions()
-
getTotalUserExceptions
public abstract double getTotalUserExceptions()
-
getLastInvocation
public abstract double getLastInvocation()
-
getAvgProcessLatency
public abstract double getAvgProcessLatency()
-
getTotalProcessedSuccessfully1min
public abstract double getTotalProcessedSuccessfully1min()
-
getTotalRecordsReceived1min
public abstract double getTotalRecordsReceived1min()
-
getTotalSysExceptions1min
public abstract double getTotalSysExceptions1min()
-
getTotalUserExceptions1min
public abstract double getTotalUserExceptions1min()
-
getAvgProcessLatency1min
public abstract double getAvgProcessLatency1min()
-
getLatestUserExceptions
public abstract com.google.common.collect.EvictingQueue<org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatus.ExceptionInformation> getLatestUserExceptions()
-
getLatestSystemExceptions
public abstract com.google.common.collect.EvictingQueue<org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatus.ExceptionInformation> getLatestSystemExceptions()
-
getLatestSourceExceptions
public abstract com.google.common.collect.EvictingQueue<org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatus.ExceptionInformation> getLatestSourceExceptions()
-
getLatestSinkExceptions
public abstract com.google.common.collect.EvictingQueue<org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatus.ExceptionInformation> getLatestSinkExceptions()
-
getStatsAsString
public java.lang.String getStatsAsString() throws java.io.IOException- Throws:
java.io.IOException
-
getExceptionInfo
protected org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatus.ExceptionInformation getExceptionInfo(java.lang.Throwable th, long ts)
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable
-
-