Class FunctionStatsManager
- java.lang.Object
-
- org.apache.pulsar.functions.instance.stats.ComponentStatsManager
-
- org.apache.pulsar.functions.instance.stats.FunctionStatsManager
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class FunctionStatsManager extends ComponentStatsManager
Function stats.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringLAST_INVOCATIONstatic java.lang.StringPROCESS_LATENCY_MSstatic java.lang.StringPROCESS_LATENCY_MS_1minstatic java.lang.StringPROCESSED_SUCCESSFULLY_TOTALDeclare metric namesstatic java.lang.StringPROCESSED_SUCCESSFULLY_TOTAL_1minstatic java.lang.StringPULSAR_FUNCTION_METRICS_PREFIXstatic java.lang.StringRECEIVED_TOTALstatic java.lang.StringRECEIVED_TOTAL_1minstatic java.lang.StringSINK_EXCEPTIONS_TOTALstatic java.lang.StringSINK_EXCEPTIONS_TOTAL_1minstatic java.lang.StringSOURCE_EXCEPTIONS_TOTALstatic java.lang.StringSOURCE_EXCEPTIONS_TOTAL_1minstatic java.lang.StringSYSTEM_EXCEPTIONS_TOTALstatic java.lang.StringSYSTEM_EXCEPTIONS_TOTAL_1minstatic java.lang.StringUSER_EXCEPTIONS_TOTALstatic java.lang.StringUSER_EXCEPTIONS_TOTAL_1min-
Fields inherited from class org.apache.pulsar.functions.instance.stats.ComponentStatsManager
collectorRegistry, EMPTY_QUEUE, exceptionMetricsLabelNames, metricsLabelNames, metricsLabels, scheduledFuture, USER_METRIC_PREFIX
-
-
Constructor Summary
Constructors Constructor Description FunctionStatsManager(FunctionCollectorRegistry collectorRegistry, java.lang.String[] metricsLabels, java.util.concurrent.ScheduledExecutorService scheduledExecutorService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSystemException(java.lang.Throwable ex)voidaddUserException(java.lang.Throwable ex)doublegetAvgProcessLatency()doublegetAvgProcessLatency1min()doublegetLastInvocation()com.google.common.collect.EvictingQueue<org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatus.ExceptionInformation>getLatestSinkExceptions()com.google.common.collect.EvictingQueue<org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatus.ExceptionInformation>getLatestSourceExceptions()doublegetProcessLatency50P()doublegetProcessLatency50P1min()doublegetProcessLatency90P()doublegetProcessLatency90P1min()doublegetProcessLatency99_9P()doublegetProcessLatency99_9P1min()doublegetProcessLatency99P()doublegetProcessLatency99P1min()doublegetTotalProcessedSuccessfully()doublegetTotalProcessedSuccessfully1min()doublegetTotalRecordsReceived()doublegetTotalRecordsReceived1min()doublegetTotalSysExceptions()doublegetTotalSysExceptions1min()doublegetTotalUserExceptions()doublegetTotalUserExceptions1min()voidincrSinkExceptions(java.lang.Throwable ex)voidincrSourceExceptions(java.lang.Throwable ex)voidincrSysExceptions(java.lang.Throwable sysException)voidincrTotalProcessedSuccessfully()voidincrTotalReceived()voidincrUserExceptions(java.lang.Throwable userException)voidprocessTimeEnd()voidprocessTimeStart()voidreset()voidsetLastInvocation(long ts)-
Methods inherited from class org.apache.pulsar.functions.instance.stats.ComponentStatsManager
close, getExceptionInfo, getLatestSystemExceptions, getLatestUserExceptions, getStatsAsString, getStatsManager
-
-
-
-
Field Detail
-
PULSAR_FUNCTION_METRICS_PREFIX
public static final java.lang.String PULSAR_FUNCTION_METRICS_PREFIX
- See Also:
- Constant Field Values
-
PROCESSED_SUCCESSFULLY_TOTAL
public static final java.lang.String PROCESSED_SUCCESSFULLY_TOTAL
Declare metric names- See Also:
- Constant Field Values
-
SYSTEM_EXCEPTIONS_TOTAL
public static final java.lang.String SYSTEM_EXCEPTIONS_TOTAL
- See Also:
- Constant Field Values
-
USER_EXCEPTIONS_TOTAL
public static final java.lang.String USER_EXCEPTIONS_TOTAL
- See Also:
- Constant Field Values
-
SOURCE_EXCEPTIONS_TOTAL
public static final java.lang.String SOURCE_EXCEPTIONS_TOTAL
- See Also:
- Constant Field Values
-
SINK_EXCEPTIONS_TOTAL
public static final java.lang.String SINK_EXCEPTIONS_TOTAL
- See Also:
- Constant Field Values
-
PROCESS_LATENCY_MS
public static final java.lang.String PROCESS_LATENCY_MS
- See Also:
- Constant Field Values
-
LAST_INVOCATION
public static final java.lang.String LAST_INVOCATION
- See Also:
- Constant Field Values
-
RECEIVED_TOTAL
public static final java.lang.String RECEIVED_TOTAL
- See Also:
- Constant Field Values
-
PROCESSED_SUCCESSFULLY_TOTAL_1min
public static final java.lang.String PROCESSED_SUCCESSFULLY_TOTAL_1min
- See Also:
- Constant Field Values
-
SYSTEM_EXCEPTIONS_TOTAL_1min
public static final java.lang.String SYSTEM_EXCEPTIONS_TOTAL_1min
- See Also:
- Constant Field Values
-
USER_EXCEPTIONS_TOTAL_1min
public static final java.lang.String USER_EXCEPTIONS_TOTAL_1min
- See Also:
- Constant Field Values
-
SOURCE_EXCEPTIONS_TOTAL_1min
public static final java.lang.String SOURCE_EXCEPTIONS_TOTAL_1min
- See Also:
- Constant Field Values
-
SINK_EXCEPTIONS_TOTAL_1min
public static final java.lang.String SINK_EXCEPTIONS_TOTAL_1min
- See Also:
- Constant Field Values
-
PROCESS_LATENCY_MS_1min
public static final java.lang.String PROCESS_LATENCY_MS_1min
- See Also:
- Constant Field Values
-
RECEIVED_TOTAL_1min
public static final java.lang.String RECEIVED_TOTAL_1min
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FunctionStatsManager
public FunctionStatsManager(FunctionCollectorRegistry collectorRegistry, java.lang.String[] metricsLabels, java.util.concurrent.ScheduledExecutorService scheduledExecutorService)
-
-
Method Detail
-
addUserException
public void addUserException(java.lang.Throwable ex)
-
addSystemException
public void addSystemException(java.lang.Throwable ex)
-
incrTotalReceived
public void incrTotalReceived()
- Specified by:
incrTotalReceivedin classComponentStatsManager
-
incrTotalProcessedSuccessfully
public void incrTotalProcessedSuccessfully()
- Specified by:
incrTotalProcessedSuccessfullyin classComponentStatsManager
-
incrSysExceptions
public void incrSysExceptions(java.lang.Throwable sysException)
- Specified by:
incrSysExceptionsin classComponentStatsManager
-
incrUserExceptions
public void incrUserExceptions(java.lang.Throwable userException)
- Specified by:
incrUserExceptionsin classComponentStatsManager
-
incrSourceExceptions
public void incrSourceExceptions(java.lang.Throwable ex)
- Specified by:
incrSourceExceptionsin classComponentStatsManager
-
incrSinkExceptions
public void incrSinkExceptions(java.lang.Throwable ex)
- Specified by:
incrSinkExceptionsin classComponentStatsManager
-
setLastInvocation
public void setLastInvocation(long ts)
- Specified by:
setLastInvocationin classComponentStatsManager
-
processTimeStart
public void processTimeStart()
- Specified by:
processTimeStartin classComponentStatsManager
-
processTimeEnd
public void processTimeEnd()
- Specified by:
processTimeEndin classComponentStatsManager
-
getTotalProcessedSuccessfully
public double getTotalProcessedSuccessfully()
- Specified by:
getTotalProcessedSuccessfullyin classComponentStatsManager
-
getTotalRecordsReceived
public double getTotalRecordsReceived()
- Specified by:
getTotalRecordsReceivedin classComponentStatsManager
-
getTotalSysExceptions
public double getTotalSysExceptions()
- Specified by:
getTotalSysExceptionsin classComponentStatsManager
-
getTotalUserExceptions
public double getTotalUserExceptions()
- Specified by:
getTotalUserExceptionsin classComponentStatsManager
-
getLastInvocation
public double getLastInvocation()
- Specified by:
getLastInvocationin classComponentStatsManager
-
getAvgProcessLatency
public double getAvgProcessLatency()
- Specified by:
getAvgProcessLatencyin classComponentStatsManager
-
getProcessLatency50P
public double getProcessLatency50P()
-
getProcessLatency90P
public double getProcessLatency90P()
-
getProcessLatency99P
public double getProcessLatency99P()
-
getProcessLatency99_9P
public double getProcessLatency99_9P()
-
getTotalProcessedSuccessfully1min
public double getTotalProcessedSuccessfully1min()
- Specified by:
getTotalProcessedSuccessfully1minin classComponentStatsManager
-
getTotalRecordsReceived1min
public double getTotalRecordsReceived1min()
- Specified by:
getTotalRecordsReceived1minin classComponentStatsManager
-
getTotalSysExceptions1min
public double getTotalSysExceptions1min()
- Specified by:
getTotalSysExceptions1minin classComponentStatsManager
-
getTotalUserExceptions1min
public double getTotalUserExceptions1min()
- Specified by:
getTotalUserExceptions1minin classComponentStatsManager
-
getAvgProcessLatency1min
public double getAvgProcessLatency1min()
- Specified by:
getAvgProcessLatency1minin classComponentStatsManager
-
getLatestSourceExceptions
public com.google.common.collect.EvictingQueue<org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatus.ExceptionInformation> getLatestSourceExceptions()
- Specified by:
getLatestSourceExceptionsin classComponentStatsManager
-
getLatestSinkExceptions
public com.google.common.collect.EvictingQueue<org.apache.pulsar.functions.proto.InstanceCommunication.FunctionStatus.ExceptionInformation> getLatestSinkExceptions()
- Specified by:
getLatestSinkExceptionsin classComponentStatsManager
-
getProcessLatency50P1min
public double getProcessLatency50P1min()
-
getProcessLatency90P1min
public double getProcessLatency90P1min()
-
getProcessLatency99P1min
public double getProcessLatency99P1min()
-
getProcessLatency99_9P1min
public double getProcessLatency99_9P1min()
-
reset
public void reset()
- Specified by:
resetin classComponentStatsManager
-
-