latency
API latency benchmark models.
Classes
class
LatencyBenchmarkResult
(BaseModel)Complete latency benchmark results.
Attributes
| Name | Type | Description |
|---|---|---|
| category_statistics | list[LatencyStatistics] | None | — |
| cf_overall_stats | StatisticalSummary | None | — |
| corpus | str | — |
| measurements | list[QueryMeasurement] | — |
| queries | list[SearchQuery] | — |
| statistics | list[LatencyStatistics] | — |
| tf_overall_stats | StatisticalSummary | None | — |
Methods
get_queries_by_category(self, category: Literal[('lexical', 'structural', 'quantified', 'complex')]) → list[SearchQuery]Get queries for a specific category.
Parameters
category: Literal[('lexical', 'structural', 'quantified', 'complex')]
get_validated_queries(self) → list[SearchQuery]Get only validated queries.
to_dict(self) → dictConvert to JSON-serializable dictionary.
to_json(self) → strSerialize to JSON string.
class
LatencyStatistics
(BaseModel)Latency statistics for a query or category.
Attributes
| Name | Type | Description |
|---|---|---|
| category | str | None | — |
| error_count | int | — |
| implementation | Literal[('TF', 'CF')] | — |
| max_ms | float | — |
| mean_ms | float | — |
| min_ms | float | — |
| p50_ms | float | — |
| p95_ms | float | — |
| p99_ms | float | — |
| query_id | str | None | — |
| sample_count | int | — |
| std_ms | float | — |
Methods
to_dict(self) → dictConvert to JSON-serializable dictionary.
class
QueryMeasurement
(BaseModel)Single query timing measurement.
Attributes
| Name | Type | Description |
|---|---|---|
| error | str | None | — |
| execution_time_ms | float | — |
| implementation | Literal[('TF', 'CF')] | — |
| iteration | int | — |
| query_id | str | — |
| result_count | int | — |
| run_id | int | — |
| success | bool | — |
Methods
to_dict(self) → dictConvert to JSON-serializable dictionary.
class
SearchQuery
(BaseModel)Search query for latency testing.
Attributes
| Name | Type | Description |
|---|---|---|
| category | Literal[('lexical', 'structural', 'quantified', 'complex')] | — |
| description | str | — |
| expected_complexity | Literal[('low', 'medium', 'high')] | — |
| id | str | — |
| template | str | — |
| validated | bool | — |
| validation_error | str | None | — |
Methods
to_dict(self) → dictConvert to JSON-serializable dictionary.
class
ValidationReport
(BaseModel)Report of query validation results.
Attributes
| Name | Type | Description |
|---|---|---|
| failed_count | int | — |
| queries | list[SearchQuery] | — |
| success_rate | float | Calculate validation success rate. |
| total_queries | int | — |
| validated_count | int | — |
| validation_corpus | str | — |
Methods
to_dict(self) → dictConvert to JSON-serializable dictionary.
to_json(self) → strSerialize to JSON string.