Direct answer: identify the timebase before computing latency
The SSL eBPF probes capture bpf_ktime_get_ns() timestamps. TimestampNormalizer replaces an event's timestamp with boot_time_seconds × 1000 + floor(boot_nanoseconds / 1,000,000). Downstream HTTP and SSE analyzers in collector/src/cmd_trace.rstherefore receive epoch-based milliseconds, not boot-time nanoseconds. The canonical view also names its resulting field timestamp_ms.
A source-level audit of the released AgentSight v1.0.35 at c1574366122a90c451bca6a84713e28813ab95e2 finds that SSEProcessor subtracts its normalized end_time and start_time directly, but serializes the answer as duration_ns. In this traced path, the number is an interval in milliseconds despite the nanosecond-looking name. That is a unit-contract discrepancy in the inspected implementation, not a new benchmark or a claim that every AgentSight export uses the same calculation.
For a different question—how AgentSight decides which request and response belong together—see HTTP exchange correlation. For missing fragments and unreliable completeness, see capture-loss evidence. Neither page is a substitute for checking the time unit of a derived duration.
Follow the timestamp through four implementation layers
- Probe: the Linux TLS instrumentation records a boot-relative
timestamp_nsfrombpf_ktime_get_ns(). This is not Unix epoch time. - Conversion:
boot_ns_to_epoch_ms()obtains boot time in whole epoch seconds (cached viaOnceLock), then adds the integer millisecond offset. This drops sub-millisecond precision. It uses a fallback based on current epoch time and system uptime if direct boot-time discovery does not yield a positive value. - Analyzer ordering:
configure_ssl_runner()attachesTimestampNormalizerbefore the two SSE passes, HTTP parsing, decompression and filtering. Its process and stdio runner paths also attach the normalizer, but native agent transcript fields have their own source semantics. - Derived event:
SSEProcessorrecords its first and latest observed fragment timestamps and emits an SSE event. Multiple-fragment output is timestamped at the last fragment; its numericduration_nsis the nonnegative difference of normalized timestamps. The HTTP event path preserves the timestamp of its original triggering event.
These steps are tied to the specific Linux SSL trace analyzer path in the inspected commit. They are not a promise of synchronized clocks across machines, agents, containers or different native-log providers. Normalization gives an epoch-like coordinate for a stream; it does not create missing observations.
Ten interpretation cases from the implementation
| Observed or synthetic input | Source behavior | Safe inference |
|---|---|---|
| A raw TLS probe timestamp is 1,500,000,000 ns after boot. | sslsniff.bpf.c records bpf_ktime_get_ns(); the converter divides by 1,000,000. | The normalized offset is 1,500 ms. Add the cached boot-time epoch milliseconds; do not read the raw number as an epoch timestamp. |
| Two raw events differ by 1,500,000 ns. | Integer division happens independently on both timestamps. | A millisecond-level event timeline may show a 1 or 2 ms difference depending on boundaries. Sub-millisecond detail is not preserved. |
| SSE fragments arrive at normalized times 1,000 and 2,000 ms. | The accumulator stores event.timestamp as start_time and end_time. | The interval between the first and last observed fragments is 1,000 ms; it is not necessarily model latency or wall time of the full request. |
| The same two fragments produce duration_ns = 1,000. | v1.0.35 computes end_time.saturating_sub(start_time) after timestamp normalization. | On the traced SSL pipeline, the numeric difference is milliseconds despite the duration_ns field name. Treat that field as a version-specific unit mismatch. |
| An SSE accumulator has only one observed event. | The start and end timestamps are identical; the emitted event preserves original_event.timestamp. | A zero difference measures the observation window, not necessarily a zero-duration model call. |
| An SSE response merges multiple observed fragments. | SSEProcessorEvent::to_event uses end_time as the aggregate event timestamp. | Place the merged event at its last observed fragment, not automatically at request start or first token. |
| An HTTP parser event is generated from a captured event. | HTTPEvent::to_event preserves original_event.timestamp. | HTTP and SSE event timestamps represent different stages. A naive cross-source subtraction is not a guaranteed request latency. |
| An accumulator goes idle for more than 30,000 normalized milliseconds. | The tracing pipeline configures SSEProcessor::new_with_timeout(30000) and compares event timestamps to last_update. | Pending assembly state can be evicted. A later fragment may no longer belong to the same accumulated observation. |
| The SSE processor reaches its 1,024-buffer cap. | It evicts the entry with the oldest last_update. | Observed span continuity can be limited by capacity, not only by a true protocol boundary. |
| A trace combines native agent records and Linux system probes. | The Linux pipeline normalizes eBPF timestamps; provider-native session data has independent provenance. | Verify clock origin and field units before comparing layers. Similar-looking timestamps do not establish complete end-to-end causality. |
The numerical examples are synthetic arithmetic inputs, not measurements from a real agent or evidence of a particular user's latency. The source documents unit conversion and assembler behavior; the table separates that behavior from broader performance conclusions.
Worked example: a thousand milliseconds labeled as nanoseconds
Suppose an SSE processor receives two normalized event timestamps: 1,780,000,000,000 ms and 1,780,000,001,000 ms. The accumulator sets start_time to the first and end_time to the second. The calculation currently written in sse_processor.rs is end_time.saturating_sub(start_time), producing 1000. The serialized name is duration_ns.
The correct physical interpretation of that numeric difference in this pipeline is 1,000 milliseconds (one second); were it actually expressed in nanoseconds, the corresponding value would be 1,000,000,000. Treating the field name as a unit contract would make the interval appear a million times shorter. The example demonstrates the source arithmetic only, not the time between an agent's prompt and its final response.
This mismatch is an implementation finding for v1.0.35. It should be corrected or explicitly normalized by downstream consumers before they compute cross-source latency. Do not silently rename the number without checking which AgentSight version and analyzer produced it.
Why an SSE interval is not a model-latency measurement
The SSE accumulator's start_time is the first captured fragment that entered this accumulator, not necessarily the point at which the user submitted a prompt, the client sent its request, or the provider began generating. Its end_time is the last observed fragment before the derived event is emitted. A single observed fragment can yield a zero interval despite nonzero network, queueing and inference time.
The inspected trace path sets new_with_timeout(30000) and evicts stale accumulators by comparing normalized event timestamps to last_update. It also caps concurrent accumulator entries at 1,024 and drops the least recently updated one when over capacity. Missing capture events, fragmented HTTP, altered TLS support, process attachment limits and incomplete protocol reconstruction can all change the observed window. A final timestamp is not proof of a provider-side finish reason.
To estimate actual request latency, prefer an instrumented request/response pair with a defined start and end, or correlate independently captured HTTP events while honoring the connection and stream matching rules. AgentSight's system boundary data can supply useful independent evidence, but it cannot reconstruct unobserved time segments simply from a merged SSE record.
Reproduce the source audit without private traces
Check out the exact product commit, then inspect the definitions and call ordering below. These commands read public source and print code locations; they do not attach probes, require elevated privileges or collect personal agent traffic.
git clone https://github.com/eunomia-bpf/agentsight.git
cd agentsight
git checkout c1574366122a90c451bca6a84713e28813ab95e2
rg -n "bpf_ktime_get_ns|timestamp_ns" bpf/sslsniff.bpf.c
rg -n "boot_ns_to_epoch_ms|1_000_000|BOOT_TIME_SECS" agentsight-capture/src/time.rs
rg -n "boot_ns_to_epoch_ms|event.timestamp" ext/analysis/src/analyzers/timestamp_normalizer.rs
rg -n "TimestampNormalizer|new_with_timeout\(30000\)|add_http_analyzers" collector/src/cmd_trace.rs
rg -n "start_time: event.timestamp|end_time: event.timestamp|duration_ns:|timeout_ms|MAX_BUFFERS" ext/analysis/src/analyzers/sse_processor.rs
rg -n "event_count > 1|original_event.timestamp|self.end_time" ext/analysis/src/analyzers/protocol_events.rsThen perform the unit calculation yourself: convert raw boot-relative nanoseconds to epoch milliseconds as in time.rs; subtract two resulting integer timestamps; compare that number with the value assigned to duration_ns. The code contains unit tests for timestamp conversion, but this article does not claim to have run a complete live TLS-capture integration test.
Limits and practical review checklist
The result depends on the inspected v1.0.35 commit and analyzer ordering. A different producer may emit different time fields, and the same word duration may refer to a span, session, process lifetime or reconstruction window. The boot-time conversion uses whole-second boot-time estimates and integer milliseconds; do not assume microsecond fidelity or exact behavior through wall-clock corrections. A mixed stream may also contain native provider records without a shared timing contract.
When investigating an apparently impossible duration: identify the emitting event source; inspect the producer's timestamp origin; confirm the normalization step that ran before aggregation; compare start/end field units; check capture-loss and correlation markers; and only then plot or aggregate the interval. A unit label is an interface claim worth testing, not stronger evidence than the source calculation.
Do not upload captured prompts, headers, credentials or private paths when reporting a timing discrepancy. A small synthetic pair of timestamps and an exact source revision are sufficient to reproduce this particular arithmetic observation.
Primary sources
All implementation statements are pinned to AgentSight product commit c1574366122a90c451bca6a84713e28813ab95e2 for the v1.0.35 release, reviewed 9 November 2026. This page contains source-derived arithmetic and analysis, not a newly measured latency benchmark or a claim about every agent runtime.
- Linux SSL probe timestamp source
- Boot-time to Unix-epoch millisecond conversion and tests
- TimestampNormalizer and its tests
- Actual SSL, HTTP and SSE analyzer ordering
- SSE accumulator lifecycle, timeout, buffer cap, and duration calculation
- Serialized SSE/HTTP event fields and output timestamps
- Canonical view timestamp_ms assignment
- AgentSight v1.0.35 release
For the complementary evidence path, read HTTP exchange matching, capture reliability, and local telemetry handling. Setup and CLI flags are maintained in the canonical AgentSight documentation.