Skip to main content
Glama
test_file_metrics_sink.py540 B
import json from pathlib import Path from monitoring.file_sink import FileMetricsSink def test_file_metrics_sink_flush(): path = Path("logs/test_metrics.jsonl") if path.exists(): path.unlink() m = FileMetricsSink(path=str(path), max_bytes=10_000) m.counter("requests").inc(2) m.timer("latency").durations.extend([0.1, 0.2]) m.flush() assert path.exists() data = [json.loads(line) for line in path.read_text(encoding="utf-8").splitlines()] assert data and data[-1]["counters"]["requests"] == 2

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Zazzles2908/EX_AI-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server