Skip to main content
Dotset CLI API Documentation / index / BatchMetrics

Interface: BatchMetrics

Defined in: src/mantle/utils/profiler.ts:576 Performance Profiling Module Measure and optimize scanning performance with profiling tools.

Example

import {
  Timer,
  Profiler,
  enableProfiling,
  formatDuration,
  formatBytes,
} from '@dotsetlabs/cli';

// Enable global profiling
enableProfiling();

// Time a specific operation
const timer = new Timer();
timer.start();
await scanLargeFile();
timer.stop();
console.log(`Scan took: ${formatDuration(timer.elapsed())}`);

// Use profiler for detailed metrics
const profiler = new Profiler('scan-operation');
profiler.start('pattern-matching');
// ... pattern matching
profiler.end('pattern-matching');

profiler.start('entropy-analysis');
// ... entropy analysis
profiler.end('entropy-analysis');

console.log(profiler.getReport());

Properties

avgPerItemMs

avgPerItemMs: number;
Defined in: src/mantle/utils/profiler.ts:580

batchId

batchId: string;
Defined in: src/mantle/utils/profiler.ts:577

endTime?

optional endTime: Date;
Defined in: src/mantle/utils/profiler.ts:583

itemCount

itemCount: number;
Defined in: src/mantle/utils/profiler.ts:578

itemsPerSecond

itemsPerSecond: number;
Defined in: src/mantle/utils/profiler.ts:581

startTime

startTime: Date;
Defined in: src/mantle/utils/profiler.ts:582

totalMs

totalMs: number;
Defined in: src/mantle/utils/profiler.ts:579