MCPcopy Create free account
hub / github.com/ZyphrZero/z.ai2api_python / get_dashboard_usage_trend

Function get_dashboard_usage_trend

app/admin/api.py:237–252  ·  view source on GitHub ↗

返回仪表盘趋势图数据。

(request: Request)

Source from the content-addressed store, hash-verified

235 dependencies=[Depends(require_auth)],
236)
237async def get_dashboard_usage_trend(request: Request):
238 """返回仪表盘趋势图数据。"""
239 trend_window = normalize_trend_window(
240 request.query_params.get("window")
241 )
242 dao = get_request_log_dao()
243 trend_points = await dao.get_provider_usage_trend(
244 DEFAULT_TOKEN_NAMESPACE,
245 window=trend_window,
246 )
247 return JSONResponse(
248 {
249 "window": trend_window,
250 "points": trend_points,
251 }
252 )
253
254
255def _validate_directory_path(source_dir: str) -> str:

Callers

nothing calls this directly

Calls 3

normalize_trend_windowFunction · 0.90
get_request_log_daoFunction · 0.90

Tested by

no test coverage detected