Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

@lanterna-profiler/core

Headless capture + analysis primitives for Lanterna — agent-first Node.js CPU, memory & experimental async profiler.

This package is TTY-free: no spinner, no prompts, no process listing. It exposes the orchestration APIs you need to capture profile data, run an analysis pipeline, and build a LanternaReport. Bring your own analyzers, or install @lanterna-profiler/detectors for the default detector pack.

Install

npm install @lanterna-profiler/core
# Add the default detector pack if you want built-in CPU/memory/async findings
npm install @lanterna-profiler/detectors

Usage

import { runProfile } from '@lanterna-profiler/core';
import { createCpuProfileKindWithBuiltInDetectors } from '@lanterna-profiler/detectors';

const report = await runProfile({
  command: ['node', 'app.js'],
  durationMs: 15_000,
  pretty: false,
  kinds: [
    createCpuProfileKindWithBuiltInDetectors({
      readStderrSoFar: () => '',
      sampleIntervalMicros: 1000,
      deep: false,
    }),
  ],
});

Documentation

Related packages