querying-mlflow-metrics by mlflow/skills
npx skills add https://github.com/mlflow/skills --skill querying-mlflow-metrics运行 scripts/fetch_metrics.py 以从 MLflow 跟踪服务器查询指标。
令牌使用量摘要:
python scripts/fetch_metrics.py -s http://localhost:5000 -x 1 -m total_tokens -a SUM,AVG
输出:AVG: 223.91 SUM: 7613
每小时令牌趋势(最近24小时):
python scripts/fetch_metrics.py -s http://localhost:5000 -x 1 -m total_tokens -a SUM \
-t 3600 --start-time="-24h" --end-time=now
输出:按小时分组的令牌总和
按跟踪划分的延迟百分位数:
python scripts/fetch_metrics.py -s http://localhost:5000 -x 1 -m latency -a AVG,P95 -d trace_name
按状态划分的错误率:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
python scripts/fetch_metrics.py -s http://localhost:5000 -x 1 -m trace_count -a COUNT -d trace_status
按评估器划分的质量分数(评估):
python scripts/fetch_metrics.py -s http://localhost:5000 -x 1 -v ASSESSMENTS \
-m assessment_value -a AVG,P50 -d assessment_name
输出:每个评估器的平均分和中位数分数(例如,正确性、相关性)
按名称划分的评估计数:
python scripts/fetch_metrics.py -s http://localhost:5000 -x 1 -v ASSESSMENTS \
-m assessment_count -a COUNT -d assessment_name
JSON 输出: 在任何命令中添加 -o json。
| 参数 | 必需 | 描述 |
|---|---|---|
-s, --server | 是 | MLflow 服务器 URL |
-x, --experiment-ids | 是 | 实验 ID(逗号分隔) |
-m, --metric | 是 | trace_count, latency, input_tokens, output_tokens, total_tokens |
-a, --aggregations | 是 | COUNT, SUM, AVG, MIN, MAX, P50, P95, P99 |
-d, --dimensions | 否 | 分组依据:trace_name, trace_status |
-t, --time-interval | 否 | 分桶大小(秒)(3600=每小时,86400=每天) |
--start-time | 否 | -24h, -7d, now, ISO 8601 或纪元毫秒 |
--end-time | 否 | 与开始时间相同的格式 |
-o, --output | 否 | table(默认)或 json |
对于 SPANS 指标(span_count, latency),请添加 -v SPANS。对于 ASSESSMENTS 指标,请添加 -v ASSESSMENTS。
有关过滤器语法和完整的 API 详细信息,请参阅 references/api_reference.md。
每周安装量
89
代码仓库
GitHub 星标数
18
首次出现
2026年2月5日
安全审计
安装于
gemini-cli88
github-copilot88
codex87
opencode86
kimi-cli85
amp85
Run scripts/fetch_metrics.py to query metrics from an MLflow tracking server.
Token usage summary:
python scripts/fetch_metrics.py -s http://localhost:5000 -x 1 -m total_tokens -a SUM,AVG
Output: AVG: 223.91 SUM: 7613
Hourly token trend (last 24h):
python scripts/fetch_metrics.py -s http://localhost:5000 -x 1 -m total_tokens -a SUM \
-t 3600 --start-time="-24h" --end-time=now
Output: Time-bucketed token sums per hour
Latency percentiles by trace:
python scripts/fetch_metrics.py -s http://localhost:5000 -x 1 -m latency -a AVG,P95 -d trace_name
Error rate by status:
python scripts/fetch_metrics.py -s http://localhost:5000 -x 1 -m trace_count -a COUNT -d trace_status
Quality scores by evaluator (assessments):
python scripts/fetch_metrics.py -s http://localhost:5000 -x 1 -v ASSESSMENTS \
-m assessment_value -a AVG,P50 -d assessment_name
Output: Average and median scores for each evaluator (e.g., correctness, relevance)
Assessment count by name:
python scripts/fetch_metrics.py -s http://localhost:5000 -x 1 -v ASSESSMENTS \
-m assessment_count -a COUNT -d assessment_name
JSON output: Add -o json to any command.
| Arg | Required | Description |
|---|---|---|
-s, --server | Yes | MLflow server URL |
-x, --experiment-ids | Yes | Experiment IDs (comma-separated) |
-m, --metric | Yes | trace_count, latency, input_tokens, output_tokens, |
For SPANS metrics (span_count, latency), add -v SPANS. For ASSESSMENTS metrics, add -v ASSESSMENTS.
See references/api_reference.md for filter syntax and full API details.
Weekly Installs
89
Repository
GitHub Stars
18
First Seen
Feb 5, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
gemini-cli88
github-copilot88
codex87
opencode86
kimi-cli85
amp85
专业SEO审计工具:全面网站诊断、技术SEO优化与页面分析指南
70,100 周安装
RAG工程师技能详解:检索增强生成系统架构与最佳实践
476 周安装
CSV/Excel合并工具 - 智能列匹配与数据去重 | 多文件合并解决方案
475 周安装
文件整理器 - 自动整理电脑文件,清理重复项,优化文件夹结构
497 周安装
Flutter Riverpod 2025 最佳实践:状态管理、代码生成与性能优化指南
492 周安装
Diátaxis技术文档框架指南:创建教程、操作指南、参考与解释说明
502 周安装
Aceternity UI - Next.js 13+ 动画React组件库 | Tailwind CSS & Framer Motion
499 周安装
total_tokens-a, --aggregations | Yes | COUNT, SUM, AVG, MIN, MAX, P50, P95, P99 |
-d, --dimensions | No | Group by: trace_name, trace_status |
-t, --time-interval | No | Bucket size in seconds (3600=hourly, 86400=daily) |
--start-time | No | -24h, -7d, now, ISO 8601, or epoch ms |
--end-time | No | Same formats as start-time |
-o, --output | No | table (default) or json |