org.apache.ignite.internal.processors.streamer

## Class StreamerMetricsHolder

- java.lang.Object
- - org.apache.ignite.internal.processors.streamer.StreamerMetricsHolder

All Implemented Interfaces:
  StreamerMetrics

    public class StreamerMetricsHolder
    extends Object
    implements StreamerMetrics

Metrics holder. Note that for current active stages we use maximum active stages over last second.

### Constructor Summary

Constructors
Constructor and Description
`StreamerMetricsHolder(StreamerStageMetricsHolder[] stageMetrics, StreamerWindowMetricsHolder[] windowMetrics, int execSvcCap)`

### Method Summary

Methods
`int` `currentActiveSessions()` Gets number of current active sessions.
`int` `executorServiceCapacity()` Gets maximum number of threads in executor service.
`int` `failuresCount()` Gets number of failures.
`int` `maximumActiveSessions()` Gets maximum number of active sessions since last reset.
`void` `onPipelineCompleted(long execTime, int execNodes)` Pipeline completed callback.
`void` `onQueryCompleted(long execTime, int execNodes)` Query completed callback.
`void` `onSessionFailed()` Session failed callback.
`void` `onSessionFinished()` Session finished callback.
`void` `onSessionStarted()` Session started callback.
`void` `onStageExecutionFinished(int idx, long execTime)` Stage execution finished callback.
`void` `onStageExecutionStarted(int idx, long waitTime)` Stage execution started callback.
`void` `onStageFailure(int idx)` Stage failure callback.
`void` `onStageScheduled()` Stage scheduled callback.
`int` `pipelineAverageExecutionNodes()` Gets average number of unique nodes participated in pipeline execution.
`long` `pipelineAverageExecutionTime()` Gets pipeline average execution time, i.e. time between execution start and time when last stage in pipeline returned empty map.
`int` `pipelineMaximumExecutionNodes()` Gets maximum number of unique nodes participated in pipeline execution.
`long` `pipelineMaximumExecutionTime()` Gets pipeline maximum execution time, i.e. time between execution start and time when last stage in pipeline returned empty map.
`int` `pipelineMinimumExecutionNodes()` Gets minimum number of unique nodes participated in pipeline execution.
`long` `pipelineMinimumExecutionTime()` Gets pipeline minimum execution time, i.e. time between execution start and time when last stage in pipeline returned empty map.
`int` `queryAverageExecutionNodes()` Gets average number of unique nodes participated in query execution.
`long` `queryAverageExecutionTime()` Gets query average execution time.
`int` `queryMaximumExecutionNodes()` Gets maximum number of unique nodes participated in query execution.
`long` `queryMaximumExecutionTime()` Gets query maximum execution time.
`int` `queryMinimumExecutionNodes()` Gets minimum number of unique nodes participated in query execution.
`long` `queryMinimumExecutionTime()` Gets query minimum execution time.
`void` `sampleCurrentStages()` Samples current sessions.
`int` `stageActiveExecutionCount()` Gets number of stages currently being executed in streamer pool.
`Collection<StreamerStageMetrics>` `stageMetrics()` Gets metrics for all stages.
`StreamerStageMetrics` `stageMetrics(String stageName)` Gets current stage metrics, if stage with given name is not configured then `IllegalArgumentException` will be thrown.
`long` `stageTotalExecutionCount()` Gets total number of stages executed since last reset.
`int` `stageWaitingExecutionCount()` Gets number of event batches currently waiting to be executed.
`Collection<StreamerWindowMetrics>` `windowMetrics()` Gets metrics for all windows.
`StreamerWindowMetrics` `windowMetrics(String winName)` Gets current window metrics, if window with given name is not configured then `IllegalArgumentException` will be thrown.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### StreamerMetricsHolder

    public StreamerMetricsHolder(StreamerStageMetricsHolder[] stageMetrics,
                         StreamerWindowMetricsHolder[] windowMetrics,
                         int execSvcCap)

Parameters:
  `stageMetrics` - Array of stage metrics holders.
  `windowMetrics` - Array of window metrics holders.
  `execSvcCap` - Executor service capacity.

### Method Detail

#### stageActiveExecutionCount

    public int stageActiveExecutionCount()

Gets number of stages currently being executed in streamer pool.

Specified by:
  `stageActiveExecutionCount` in interface `StreamerMetrics`
Returns:
  Number of stages. Cannot be more than pool thread count.

#### stageWaitingExecutionCount

    public int stageWaitingExecutionCount()

Gets number of event batches currently waiting to be executed.

Specified by:
  `stageWaitingExecutionCount` in interface `StreamerMetrics`
Returns:
  Number of event batches waiting to be processed.

#### stageTotalExecutionCount

    public long stageTotalExecutionCount()

Gets total number of stages executed since last reset.

Specified by:
  `stageTotalExecutionCount` in interface `StreamerMetrics`
Returns:
  Total number of stages executed since last reset.

#### pipelineMaximumExecutionTime

    public long pipelineMaximumExecutionTime()

Gets pipeline maximum execution time, i.e. time between execution start and time when last stage in pipeline returned empty map. If pipeline execution was split to different nodes, metrics for each split will be recorded independently.

Specified by:
  `pipelineMaximumExecutionTime` in interface `StreamerMetrics`
Returns:
  Pipeline maximum execution time.

#### pipelineMinimumExecutionTime

    public long pipelineMinimumExecutionTime()

Gets pipeline minimum execution time, i.e. time between execution start and time when last stage in pipeline returned empty map. If pipeline execution was split to different nodes, metrics for each split will be recorded independently.

Specified by:
  `pipelineMinimumExecutionTime` in interface `StreamerMetrics`
Returns:
  Pipeline minimum execution time.

#### pipelineAverageExecutionTime

    public long pipelineAverageExecutionTime()

Gets pipeline average execution time, i.e. time between execution start and time when last stage in pipeline returned empty map. If pipeline execution was split, metrics for each split will be recorded independently.

Specified by:
  `pipelineAverageExecutionTime` in interface `StreamerMetrics`
Returns:
  Pipeline average execution time.

#### pipelineMaximumExecutionNodes

    public int pipelineMaximumExecutionNodes()

Gets maximum number of unique nodes participated in pipeline execution. If pipeline execution was split, metrics for each split will be recorded independently.

Specified by:
  `pipelineMaximumExecutionNodes` in interface `StreamerMetrics`
Returns:
  Maximum number of unique nodes in pipeline execution.

#### pipelineMinimumExecutionNodes

    public int pipelineMinimumExecutionNodes()

Gets minimum number of unique nodes participated in pipeline execution. If pipeline execution was split, metrics for each split will be recorded independently.

Specified by:
  `pipelineMinimumExecutionNodes` in interface `StreamerMetrics`
Returns:
  Minimum number of unique nodes in pipeline execution.

#### pipelineAverageExecutionNodes

    public int pipelineAverageExecutionNodes()

Gets average number of unique nodes participated in pipeline execution. If pipeline execution was split, metrics for each split will be recorded independently.

Specified by:
  `pipelineAverageExecutionNodes` in interface `StreamerMetrics`
Returns:
  Average number of unique nodes in pipeline execution.

#### queryMaximumExecutionTime

    public long queryMaximumExecutionTime()

Gets query maximum execution time. If query execution was split to different nodes, metrics for each split will be recorded independently.

Specified by:
  `queryMaximumExecutionTime` in interface `StreamerMetrics`
Returns:
  Query maximum execution time.

#### queryMinimumExecutionTime

    public long queryMinimumExecutionTime()

Gets query minimum execution time. If query execution was split to different nodes, metrics for each split will be recorded independently.

Specified by:
  `queryMinimumExecutionTime` in interface `StreamerMetrics`
Returns:
  Query minimum execution time.

#### queryAverageExecutionTime

    public long queryAverageExecutionTime()

Gets query average execution time. If query execution was split to different nodes, metrics for each split will be recorded independently.

Specified by:
  `queryAverageExecutionTime` in interface `StreamerMetrics`
Returns:
  Query average execution time.

#### queryMaximumExecutionNodes

    public int queryMaximumExecutionNodes()

Gets maximum number of unique nodes participated in query execution. If query execution was split, metrics for each split will be recorded independently.

Specified by:
  `queryMaximumExecutionNodes` in interface `StreamerMetrics`
Returns:
  Maximum number of unique nodes in query execution.

#### queryMinimumExecutionNodes

    public int queryMinimumExecutionNodes()

Gets minimum number of unique nodes participated in query execution. If query execution was split, metrics for each split will be recorded independently.

Specified by:
  `queryMinimumExecutionNodes` in interface `StreamerMetrics`
Returns:
  Minimum number of unique nodes in query execution.

#### queryAverageExecutionNodes

    public int queryAverageExecutionNodes()

Gets average number of unique nodes participated in query execution. If query execution was split, metrics for each split will be recorded independently.

Specified by:
  `queryAverageExecutionNodes` in interface `StreamerMetrics`
Returns:
  Average number of unique nodes in query execution.

#### currentActiveSessions

    public int currentActiveSessions()

Gets number of current active sessions. Since event execution sessions are tracked only when `atLeastOnce` configuration property is set to `true`, this metric will be collected only in this case. When `atLeastOnce` is set to `false`, this metric will always be zero.

Specified by:
  `currentActiveSessions` in interface `StreamerMetrics`
Returns:
  Number of current active sessions.

#### maximumActiveSessions

    public int maximumActiveSessions()

Gets maximum number of active sessions since last reset. Since event execution sessions are tracked only when `atLeastOnce` configuration property is set to `true`, this metric will be collected only in this case. When `atLeastOnce` is set to `false`, this metric will always be zero.

Specified by:
  `maximumActiveSessions` in interface `StreamerMetrics`
Returns:
  Maximum active sessions since last reset.

#### failuresCount

    public int failuresCount()

Gets number of failures. If `atLeastOnce` flag is set to steamer configuration, then only root node failures will be counted. Otherwise each node will count failures independently.

Specified by:
  `failuresCount` in interface `StreamerMetrics`
Returns:
  Failures count.

#### executorServiceCapacity

    public int executorServiceCapacity()

Gets maximum number of threads in executor service.

Specified by:
  `executorServiceCapacity` in interface `StreamerMetrics`
Returns:
  Maximum number of threads in executor service.

#### stageMetrics

    public StreamerStageMetrics stageMetrics(String stageName)

Gets current stage metrics, if stage with given name is not configured then `IllegalArgumentException` will be thrown.

Specified by:
  `stageMetrics` in interface `StreamerMetrics`
Parameters:
  `stageName` - Stage name.
Returns:
  Stage metrics.

#### stageMetrics

    public Collection<StreamerStageMetrics> stageMetrics()

Gets metrics for all stages. Stage metrics order is the same as stage order in configuration.

Specified by:
  `stageMetrics` in interface `StreamerMetrics`
Returns:
  Stage metrics collection.

#### windowMetrics

    public StreamerWindowMetrics windowMetrics(String winName)

Gets current window metrics, if window with given name is not configured then `IllegalArgumentException` will be thrown.

Specified by:
  `windowMetrics` in interface `StreamerMetrics`
Parameters:
  `winName` - Window name.
Returns:
  Window metrics.

#### windowMetrics

    public Collection<StreamerWindowMetrics> windowMetrics()

Gets metrics for all windows.

Specified by:
  `windowMetrics` in interface `StreamerMetrics`
Returns:
  Collection of window metrics.

#### onStageScheduled

    public void onStageScheduled()

Stage scheduled callback.

#### onStageExecutionStarted

    public void onStageExecutionStarted(int idx,
                               long waitTime)

Stage execution started callback.

Parameters:
  `idx` - Stage index.
  `waitTime` - Stage wait time.

#### onStageExecutionFinished

    public void onStageExecutionFinished(int idx,
                                long execTime)

Stage execution finished callback.

Parameters:
  `idx` - Stage index.
  `execTime` - Stage execution time.

#### onPipelineCompleted

    public void onPipelineCompleted(long execTime,
                           int execNodes)

Pipeline completed callback.

Parameters:
  `execTime` - Pipeline execution time.
  `execNodes` - Pipeline execution nodes.

#### onQueryCompleted

    public void onQueryCompleted(long execTime,
                        int execNodes)

Query completed callback.

Parameters:
  `execTime` - Query execution time.
  `execNodes` - Query execution nodes.

#### onSessionStarted

    public void onSessionStarted()

Session started callback.

#### onSessionFinished

    public void onSessionFinished()

Session finished callback.

#### onSessionFailed

    public void onSessionFailed()

Session failed callback.

#### onStageFailure

    public void onStageFailure(int idx)

Stage failure callback.

Parameters:
  `idx` - Stage index.

#### sampleCurrentStages

    public void sampleCurrentStages()

Samples current sessions.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC1
Release Date | : February 17 2015