storage
storage
¤
Storage backends for metrics data.
Classes:
Name | Description |
---|---|
JSONLinesStorage |
Storage backend using JSON Lines format. |
JSONLinesStorage
¤
JSONLinesStorage(base_path: Path)
Storage backend using JSON Lines format.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
Path
|
Base directory for storing metrics files |
required |
Methods:
Name | Description |
---|---|
get_record_by_id |
Get a specific record by run ID. |
list_files |
List all metrics files. |
read_records |
Read metrics records from storage. |
write_record |
Write a metrics record to storage. |
Source code in .venv/lib/python3.10/site-packages/panther/metrics/storage.py
12 13 14 15 16 17 18 19 |
|
get_record_by_id
¤
get_record_by_id(run_id: str) -> dict[str, Any] | None
Get a specific record by run ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
The run ID to search for |
required |
Returns:
Type | Description |
---|---|
dict[str, Any] | None
|
The matching record or None |
Source code in .venv/lib/python3.10/site-packages/panther/metrics/storage.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
|
list_files
¤
list_files() -> list[Path]
List all metrics files.
Source code in .venv/lib/python3.10/site-packages/panther/metrics/storage.py
108 109 110 |
|
read_records
¤
Read metrics records from storage.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str | None
|
Optional date filter (YYYY-MM-DD format) |
None
|
|
int | None
|
Optional limit on number of records to return |
None
|
Returns:
Type | Description |
---|---|
list[dict[str, Any]]
|
List of metrics records |
Source code in .venv/lib/python3.10/site-packages/panther/metrics/storage.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
|
write_record
¤
write_record(record: dict[str, Any]) -> None
Write a metrics record to storage.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
dict[str, Any]
|
The metrics record to store |
required |
Source code in .venv/lib/python3.10/site-packages/panther/metrics/storage.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|