org.apache.ignite.internal.processors.performancestatistics

## Class FilePerformanceStatisticsWriter

- java.lang.Object
- - org.apache.ignite.internal.processors.performancestatistics.FilePerformanceStatisticsWriter

    public class FilePerformanceStatisticsWriter
    extends Object

Performance statistics writer based on logging to a file.

Each node collects statistics to a file placed under `PERF_STAT_DIR`.

To iterate over records use `FilePerformanceStatisticsReader`.

### Field Summary

Fields
`static int` `DFLT_BUFFER_SIZE` Default off heap buffer size in bytes.
`static int` `DFLT_CACHED_STRINGS_THRESHOLD` Default maximum cached strings threshold.
`static long` `DFLT_FILE_MAX_SIZE` Default maximum file size in bytes.
`static int` `DFLT_FLUSH_SIZE` Default minimal batch size to flush in bytes.
`static String` `PERF_STAT_DIR` Directory to store performance statistics files.

### Constructor Summary

Constructors
Constructor and Description
`FilePerformanceStatisticsWriter(GridKernalContext ctx)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `cacheOperation(OperationType type, int cacheId, long startTime, long duration)`
`void` `cacheStart(int cacheId, String name)`
`void` `job(IgniteUuid sesId, long queuedTime, long startTime, long duration, boolean timedOut)`
`void` `query(GridCacheQueryType type, String text, long id, long startTime, long duration, boolean success)`
`void` `queryReads(GridCacheQueryType type, UUID queryNodeId, long id, long logicalReads, long physicalReads)`
`void` `start()` Starts collecting performance statistics.
`void` `stop()` Stops collecting performance statistics.
`void` `task(IgniteUuid sesId, String taskName, long startTime, long duration, int affPartId)`
`void` `transaction(GridIntList cacheIds, long startTime, long duration, boolean commited)`

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

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

### Field Detail

#### PERF_STAT_DIR

    public static final String PERF_STAT_DIR

Directory to store performance statistics files. Placed under Ignite work directory.

See Also:
  Constant Field Values

#### DFLT_FILE_MAX_SIZE

    public static final long DFLT_FILE_MAX_SIZE

Default maximum file size in bytes. Performance statistics will be stopped when the size exceeded.

See Also:
  Constant Field Values

#### DFLT_BUFFER_SIZE

    public static final int DFLT_BUFFER_SIZE

Default off heap buffer size in bytes.

See Also:
  Constant Field Values

#### DFLT_FLUSH_SIZE

    public static final int DFLT_FLUSH_SIZE

Default minimal batch size to flush in bytes.

See Also:
  Constant Field Values

#### DFLT_CACHED_STRINGS_THRESHOLD

    public static final int DFLT_CACHED_STRINGS_THRESHOLD

Default maximum cached strings threshold. String caching will stop on threshold excess.

See Also:
  Constant Field Values

### Constructor Detail

#### FilePerformanceStatisticsWriter

    public FilePerformanceStatisticsWriter(GridKernalContext ctx)
                                    throws IgniteCheckedException,
                                           IOException

Parameters:
  `ctx` - Kernal context.
Throws:
  `IgniteCheckedException`
  `IOException`

### Method Detail

#### start

    public void start()

Starts collecting performance statistics.

#### stop

    public void stop()

Stops collecting performance statistics.

#### cacheStart

    public void cacheStart(int cacheId,
                           String name)

Parameters:
  `cacheId` - Cache id.
  `name` - Cache name.

#### cacheOperation

    public void cacheOperation(OperationType type,
                               int cacheId,
                               long startTime,
                               long duration)

Parameters:
  `type` - Operation type.
  `cacheId` - Cache id.
  `startTime` - Start time in milliseconds.
  `duration` - Duration in nanoseconds.

#### transaction

    public void transaction(GridIntList cacheIds,
                            long startTime,
                            long duration,
                            boolean commited)

Parameters:
  `cacheIds` - Cache IDs.
  `startTime` - Start time in milliseconds.
  `duration` - Duration in nanoseconds.
  `commited` - `True` if commited.

#### query

    public void query(GridCacheQueryType type,
                      String text,
                      long id,
                      long startTime,
                      long duration,
                      boolean success)

Parameters:
  `type` - Cache query type.
  `text` - Query text in case of SQL query. Cache name in case of SCAN query.
  `id` - Query id.
  `startTime` - Start time in milliseconds.
  `duration` - Duration in nanoseconds.
  `success` - Success flag.

#### queryReads

    public void queryReads(GridCacheQueryType type,
                           UUID queryNodeId,
                           long id,
                           long logicalReads,
                           long physicalReads)

Parameters:
  `type` - Cache query type.
  `queryNodeId` - Originating node id.
  `id` - Query id.
  `logicalReads` - Number of logical reads.
  `physicalReads` - Number of physical reads.

#### task

    public void task(IgniteUuid sesId,
                     String taskName,
                     long startTime,
                     long duration,
                     int affPartId)

Parameters:
  `sesId` - Session id.
  `taskName` - Task name.
  `startTime` - Start time in milliseconds.
  `duration` - Duration.
  `affPartId` - Affinity partition id.

#### job

    public void job(IgniteUuid sesId,
                    long queuedTime,
                    long startTime,
                    long duration,
                    boolean timedOut)

Parameters:
  `sesId` - Session id.
  `queuedTime` - Time job spent on waiting queue.
  `startTime` - Start time in milliseconds.
  `duration` - Job execution time.
  `timedOut` - `True` if job is timed out.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.10.0
Release Date | : March 10 2021