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

Interface: MemorySnapshot

Defined in: src/shield/utils/profiler.ts:34 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

arrayBuffers

arrayBuffers: number;
Defined in: src/shield/utils/profiler.ts:39

external

external: number;
Defined in: src/shield/utils/profiler.ts:38

heapTotal

heapTotal: number;
Defined in: src/shield/utils/profiler.ts:37

heapUsed

heapUsed: number;
Defined in: src/shield/utils/profiler.ts:36

rss

rss: number;
Defined in: src/shield/utils/profiler.ts:40

timestamp

timestamp: Date;
Defined in: src/shield/utils/profiler.ts:35