MCPcopy Create free account
hub / github.com/AgentOps-AI/agentops / get_count

Function get_count

app/api/agentops/common/rate_limit.py:60–66  ·  view source on GitHub ↗

Get the current count of requests for the given IP within the rate limit window. This is primarily used for testing.

(ip: str)

Source from the content-addressed store, hash-verified

58
59
60def get_count(ip: str) -> int:
61 """
62 Get the current count of requests for the given IP within the rate limit window.
63 This is primarily used for testing.
64 """
65 key, now = _key(ip), _now_us()
66 return cache.zcount(key, now - WINDOW_US, now)

Callers

nothing calls this directly

Calls 3

_keyFunction · 0.85
_now_usFunction · 0.85
zcountMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…