Skip to main content
Glama
predictive.py736 B
from __future__ import annotations from collections import deque from typing import Deque, Tuple class HealthTrendStore: """In-memory rolling metrics with basic degrade detection.""" def __init__(self, window: int = 5, threshold: float = 0.8) -> None: self.window = window self.threshold = threshold self.values: Deque[float] = deque(maxlen=window) def add_metric(self, value: float) -> None: self.values.append(float(value)) def average(self) -> float: return sum(self.values) / len(self.values) if self.values else 1.0 def is_degrading(self) -> bool: if len(self.values) < self.window: return False return self.average() < self.threshold

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