Skip to main content

Class: BatchWatcher

Defined in: watchers/batch.watcher.ts:26

BatchWatcher tracks batch/bulk operations in NestJS applications. Monitors batch processing operations, capturing total/processed/failed items, duration, memory usage, and status.

Implements​

  • OnModuleInit
  • OnModuleDestroy

Constructors​

Constructor​

new BatchWatcher(collector, nestlensConfig, batchProcessor?): BatchWatcher

Defined in: watchers/batch.watcher.ts:31

Parameters​

collector​

CollectorService

nestlensConfig​

NestLensConfig

batchProcessor?​

unknown

Returns​

BatchWatcher

Methods​

onModuleDestroy()​

onModuleDestroy(): void

Defined in: watchers/batch.watcher.ts:115

Returns​

void

Implementation of​

OnModuleDestroy.onModuleDestroy


onModuleInit()​

onModuleInit(): void

Defined in: watchers/batch.watcher.ts:43

Returns​

void

Implementation of​

OnModuleInit.onModuleInit


trackBatch()​

trackBatch(name, operation, totalItems, processedItems, failedItems, duration, options?): void

Defined in: watchers/batch.watcher.ts:132

Manual tracking method for batch operations. Call this method to track batch operations that aren't automatically intercepted.

Parameters​

name​

string

Name of the batch operation

operation​

string

Type of operation (e.g., 'import', 'export', 'transform')

totalItems​

number

Total number of items to process

processedItems​

number

Number of items successfully processed

failedItems​

number

Number of items that failed

duration​

number

Duration in milliseconds

options?​

Additional options (batchSize, errors, memory)

batchSize?​

number

errors?​

string[]

memory?​

number

Returns​

void