Skip to main content

TelemetryRotator

@hardkas/core


@hardkas/core / TelemetryRotator

Class: TelemetryRotator

Defined in: packages/core/src/retention.ts:11

Constructors​

Constructor​

new TelemetryRotator(): TelemetryRotator

Returns​

TelemetryRotator

Methods​

forceRotate()​

static forceRotate(rootDir): RotationResult

Defined in: packages/core/src/retention.ts:43

Forces a rotation regardless of file size.

Parameters​

rootDir​

string

Returns​

RotationResult


listArchivedSegments()​

static listArchivedSegments(rootDir): string[]

Defined in: packages/core/src/retention.ts:76

Lists all archived telemetry segments.

Parameters​

rootDir​

string

Returns​

string[]


rotateIfNeeded()​

static rotateIfNeeded(rootDir, maxSizeBytes?): RotationResult

Defined in: packages/core/src/retention.ts:18

Rotates the telemetry stream if it exceeds the maximum size. This is a safe operation that renames the active file to an archive directory.

Parameters​

rootDir​

string

maxSizeBytes?​

number = ...

Returns​

RotationResult