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` `checkpoint(long beforeLockDuration, long lockWaitDuration, long listenersExecDuration, long markDuration, long lockHoldDuration, long pagesWriteDuration, long fsyncDuration, long walCpRecordFsyncDuration, long writeCpEntryDuration, long splitAndSortCpPagesDuration, long totalDuration, long cpStartTime, int pagesSize, int dataPagesWritten, int cowPagesWritten)`
`void` `job(IgniteUuid sesId, long queuedTime, long startTime, long duration, boolean timedOut)`
`void` `pagesWriteThrottle(long endTime, long duration)`
`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.

#### checkpoint

    public void checkpoint(long beforeLockDuration,
                           long lockWaitDuration,
                           long listenersExecDuration,
                           long markDuration,
                           long lockHoldDuration,
                           long pagesWriteDuration,
                           long fsyncDuration,
                           long walCpRecordFsyncDuration,
                           long writeCpEntryDuration,
                           long splitAndSortCpPagesDuration,
                           long totalDuration,
                           long cpStartTime,
                           int pagesSize,
                           int dataPagesWritten,
                           int cowPagesWritten)

Parameters:
  `beforeLockDuration` - Before lock duration.
  `lockWaitDuration` - Lock wait duration.
  `listenersExecDuration` - Listeners execute duration.
  `markDuration` - Mark duration.
  `lockHoldDuration` - Lock hold duration.
  `pagesWriteDuration` - Pages write duration.
  `fsyncDuration` - Fsync duration.
  `walCpRecordFsyncDuration` - Wal cp record fsync duration.
  `writeCpEntryDuration` - Write checkpoint entry duration.
  `splitAndSortCpPagesDuration` - Split and sort cp pages duration.
  `totalDuration` - Total duration in milliseconds.
  `cpStartTime` - Checkpoint start time in milliseconds.
  `pagesSize` - Pages size.
  `dataPagesWritten` - Data pages written.
  `cowPagesWritten` - Cow pages written.

#### pagesWriteThrottle

    public void pagesWriteThrottle(long endTime,
                                   long duration)

Parameters:
  `endTime` - End time in milliseconds.
  `duration` - Duration in milliseconds.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.15.0
Release Date | : April 25 2023