@codesoul-co/hypha-memory / memory-operational-metrics
- Package index:
@codesoul-co/hypha-memory - Source:
packages/memory/src/memory-operational-metrics.ts - Exports: 7
Using this module
Use the Memory operational metrics module for using the public contracts and operations for this capability boundary. It exports 1 class, 1 function, 4 interfaces, 1 type.
Import from the package entrypoint
import {
MemoryOperationalMetrics,
sanitizeMemoryOperationalValue,
} from '@codesoul-co/hypha-memory';
import type {
MemoryOperationalMetricLabels,
MemoryOperationalMetricSample,
MemoryOperationalMetricsSnapshot,
MemoryOperationalRedactionPolicy,
MemoryOperationalMetricKind,
} from '@codesoul-co/hypha-memory';Usage patterns
- Use the 5 type/interface exports as static contracts in application code, adapters, or tests. Import them with
import type; they do not exist at runtime. - The module exposes 1 class as constructable runtime implementations. Each symbol entry lists its constructor and public methods.
- The module exposes 1 function as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.
Public exports
| Symbol | Kind | Signature | Description |
|---|---|---|---|
MemoryOperationalMetrics | class | new MemoryOperationalMetrics(maxSamples?: number): MemoryOperationalMetrics | Bounded operational metrics that deliberately exclude scope, Memory content, Provider payloads, credentials and host paths from metric labels. |
sanitizeMemoryOperationalValue | function | sanitizeMemoryOperationalValue(value: unknown, policy?: MemoryOperationalRedactionPolicy): unknown | Produces log/evidence-safe data without mutating the supplied value. |
MemoryOperationalMetricLabels | interface | interface MemoryOperationalMetricLabels | Memory Operational Metric Labels interface with 5 public fields or methods. |
MemoryOperationalMetricSample | interface | interface MemoryOperationalMetricSample | Memory Operational Metric Sample interface with 3 public fields or methods. |
MemoryOperationalMetricsSnapshot | interface | interface MemoryOperationalMetricsSnapshot | Memory Operational Metrics Snapshot interface with 3 public fields or methods. |
MemoryOperationalRedactionPolicy | interface | interface MemoryOperationalRedactionPolicy | Memory Operational Redaction Policy interface with 3 public fields or methods. |
MemoryOperationalMetricKind | type | type MemoryOperationalMetricKind = 'latency_ms' | 'retry' | 'reconcile' | 'lease_contention' | 'dlq' | 'cache_bypass' | 'scope_rejection' | Public type alias for Memory Operational Metric Kind; the declaration contains its complete type expression. |
MemoryOperationalMetrics
Bounded operational metrics that deliberately exclude scope, Memory content, Provider payloads, credentials and host paths from metric labels.
- Kind: class
- Import:
import { MemoryOperationalMetrics } from '@codesoul-co/hypha-memory'; - Source module:
memory-operational-metrics
Declaration
export declare class MemoryOperationalMetrics {
constructor(maxSamples?: number);
record(kind: MemoryOperationalMetricKind, value?: number, labels?: MemoryOperationalMetricLabels): void;
observeCacheEvent(event: MemorySearchCacheEvent): void;
observeIndexEvent(event: IndexOutboxWorkerEvent): void;
observeLifecycleEvent(event: MemoryLifecycleWorkerEvent): void;
snapshot(): MemoryOperationalMetricsSnapshot;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
constructor | constructor | (maxSamples?: number): MemoryOperationalMetrics | Creates an instance of this class. |
observeCacheEvent | method | observeCacheEvent(event: MemorySearchCacheEvent): void | Public method; parameters and return type are shown in the signature. |
observeIndexEvent | method | observeIndexEvent(event: IndexOutboxWorkerEvent): void | Public method; parameters and return type are shown in the signature. |
observeLifecycleEvent | method | observeLifecycleEvent(event: MemoryLifecycleWorkerEvent): void | Public method; parameters and return type are shown in the signature. |
record | method | record(kind: MemoryOperationalMetricKind, value?: number, labels?: MemoryOperationalMetricLabels): void | Public method; parameters and return type are shown in the signature. |
snapshot | method | snapshot(): MemoryOperationalMetricsSnapshot | Public method; parameters and return type are shown in the signature. |
sanitizeMemoryOperationalValue
Produces log/evidence-safe data without mutating the supplied value.
- Kind: function
- Import:
import { sanitizeMemoryOperationalValue } from '@codesoul-co/hypha-memory'; - Source module:
memory-operational-metrics
Declaration
export declare function sanitizeMemoryOperationalValue(value: unknown, policy?: MemoryOperationalRedactionPolicy): unknown;Call signature
sanitizeMemoryOperationalValue(value: unknown, policy?: MemoryOperationalRedactionPolicy): unknownProduces log/evidence-safe data without mutating the supplied value.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
value | unknown | Yes | Required parameter; accepted values are defined by the type column. |
policy | MemoryOperationalRedactionPolicy | No | Optional parameter; accepted values are defined by the type column. |
Returns
- Type:
unknown - Description: The return contract is defined by the type shown above.
MemoryOperationalMetricLabels
Memory Operational Metric Labels interface with 5 public fields or methods.
- Kind: interface
- Import:
import type { MemoryOperationalMetricLabels } from '@codesoul-co/hypha-memory'; - Source module:
memory-operational-metrics
Declaration
export interface MemoryOperationalMetricLabels {
providerId?: string;
operation?: string;
workerType?: string;
reason?: string;
errorCode?: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
errorCode | property | errorCode?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
operation | property | operation?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
providerId | property | providerId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
reason | property | reason?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
workerType | property | workerType?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
MemoryOperationalMetricSample
Memory Operational Metric Sample interface with 3 public fields or methods.
- Kind: interface
- Import:
import type { MemoryOperationalMetricSample } from '@codesoul-co/hypha-memory'; - Source module:
memory-operational-metrics
Declaration
export interface MemoryOperationalMetricSample {
kind: MemoryOperationalMetricKind;
value: number;
labels: MemoryOperationalMetricLabels;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
kind | property | kind: MemoryOperationalMetricKind | Public property; its type, readonly modifier and optionality are shown in the signature. |
labels | property | labels: MemoryOperationalMetricLabels | Public property; its type, readonly modifier and optionality are shown in the signature. |
value | property | value: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
MemoryOperationalMetricsSnapshot
Memory Operational Metrics Snapshot interface with 3 public fields or methods.
- Kind: interface
- Import:
import type { MemoryOperationalMetricsSnapshot } from '@codesoul-co/hypha-memory'; - Source module:
memory-operational-metrics
Declaration
export interface MemoryOperationalMetricsSnapshot {
counters: Partial<Record<Exclude<MemoryOperationalMetricKind, 'latency_ms'>, number>>;
latencyMs: {
count: number;
p50: number | null;
p95: number | null;
max: number | null;
};
samples: MemoryOperationalMetricSample[];
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
counters | property | counters: Partial<Record<"retry" | "reconcile" | "dlq" | "lease_contention" | "cache_bypass" | "scope_rejection", number>> | Public property; its type, readonly modifier and optionality are shown in the signature. |
latencyMs | property | latencyMs: { count: number; p50: number | null; p95: number | null; max: number | null; } | Public property; its type, readonly modifier and optionality are shown in the signature. |
samples | property | samples: MemoryOperationalMetricSample[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
MemoryOperationalRedactionPolicy
Memory Operational Redaction Policy interface with 3 public fields or methods.
- Kind: interface
- Import:
import type { MemoryOperationalRedactionPolicy } from '@codesoul-co/hypha-memory'; - Source module:
memory-operational-metrics
Declaration
export interface MemoryOperationalRedactionPolicy {
contentMode?: 'redact' | 'hash';
hostPathMode?: 'redact' | 'basename';
maxDepth?: number;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
contentMode | property | contentMode?: "hash" | "redact" | Public property; its type, readonly modifier and optionality are shown in the signature. |
hostPathMode | property | hostPathMode?: "redact" | "basename" | Public property; its type, readonly modifier and optionality are shown in the signature. |
maxDepth | property | maxDepth?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
MemoryOperationalMetricKind
Public type alias for Memory Operational Metric Kind; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { MemoryOperationalMetricKind } from '@codesoul-co/hypha-memory'; - Source module:
memory-operational-metrics
Declaration
export type MemoryOperationalMetricKind = 'latency_ms' | 'retry' | 'reconcile' | 'lease_contention' | 'dlq' | 'cache_bypass' | 'scope_rejection';