Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions tests/metrics_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,29 @@

from __future__ import annotations

import platform

from typesense.metrics import Metrics


def test_actual_retrieve(actual_metrics: Metrics) -> None:
"""Test that the Debug object can retrieve a debug on Typesense server and verify response structure."""
response = actual_metrics.retrieve()

assert "system_cpu_active_percentage" in response
if platform.system() == "Linux":
assert "system_cpu_active_percentage" in response
assert "system_network_received_bytes" in response
assert "system_network_sent_bytes" in response

assert "system_disk_total_bytes" in response
assert "system_disk_used_bytes" in response
assert "system_memory_total_bytes" in response
assert "system_memory_used_bytes" in response
assert "system_network_received_bytes" in response
assert "system_network_sent_bytes" in response
assert "typesense_memory_active_bytes" in response
assert "typesense_memory_allocated_bytes" in response
assert "typesense_memory_fragmentation_ratio" in response

assert "typesense_memory_mapped_bytes" in response
assert "typesense_memory_metadata_bytes" in response
assert "typesense_memory_resident_bytes" in response
assert "typesense_memory_retained_bytes" in response
assert "typesense_memory_retained_bytes" in response