# Class LatencySampler

Sample collector for latency measurements.

- Defined in packages/nexus-agents/src/benchmarks/benchmark-runner.ts:29

##### Index

### Constructors

constructor

### Methods

start
end
record
getMetrics
reset

## Constructors

### constructor

- new LatencySampler(): LatencySampler

  #### Returns LatencySampler

## Methods

### start

- start(id: string): void

  Start timing an operation.

  #### Parameters

  - id: string

  #### Returns void

  - Defined in packages/nexus-agents/src/benchmarks/benchmark-runner.ts:36

### end

- end(id: string): number

  End timing and record the sample.

  #### Parameters

  - id: string

  #### Returns number

  - Defined in packages/nexus-agents/src/benchmarks/benchmark-runner.ts:43

### record

- record(durationMs: number): void

  Record a sample directly.

  #### Parameters

  - durationMs: number

  #### Returns void

  - Defined in packages/nexus-agents/src/benchmarks/benchmark-runner.ts:62

### getMetrics

- getMetrics(): LatencyMetrics

  Calculate latency metrics from collected samples.

  #### Returns LatencyMetrics

  - Defined in packages/nexus-agents/src/benchmarks/benchmark-runner.ts:69

### reset

- reset(): void

  Reset collected samples.

  #### Returns void

  - Defined in packages/nexus-agents/src/benchmarks/benchmark-runner.ts:100