bfi-cli 0.1.67 → 0.1.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.mjs +12 -7
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -8411,17 +8411,20 @@ async function runYmc(args, globalOpts) {
8411
8411
  case "url-stats": {
8412
8412
  const uri = positionals(rest)[0];
8413
8413
  if (!uri) {
8414
- console.error("用法:bfi ymc url-stats </uri> -e <env> [-t <time> | --start-time <t> [--end-time <t>]]");
8414
+ console.error("用法:bfi ymc url-stats </uri> -e <env> [-t <time>] [--app <service_name>]");
8415
8415
  process.exit(1);
8416
8416
  }
8417
- emit(await api.call("kibana/stats", {
8417
+ const body = {
8418
8418
  uri,
8419
8419
  ...requireEnv(rest),
8420
8420
  ...timeOpts(rest)
8421
- }), jsonMode, (data) => {
8421
+ };
8422
+ const app = opt(rest, "--app");
8423
+ if (app) body.filters = { service_name: app };
8424
+ emit(await api.call("kibana/stats", body), jsonMode, (data) => {
8422
8425
  const d = data;
8423
8426
  const a = d.aggs;
8424
- return `✓ URL 统计: QPS=${a.qps} avg=${a.avg_rt?.value ?? "-"} 慢请求Top=${Array.isArray(d.slow_top) ? d.slow_top.length : 0}`;
8427
+ return `✓ URL 统计${app ? ` [${app}]` : "(⚠️ 未限定服务,共享路径为全平台混合)"}: QPS=${a.qps} avg=${a.avg_rt?.value ?? "-"} 慢请求Top=${Array.isArray(d.slow_top) ? d.slow_top.length : 0}`;
8425
8428
  });
8426
8429
  break;
8427
8430
  }
@@ -8433,12 +8436,14 @@ async function runYmc(args, globalOpts) {
8433
8436
  };
8434
8437
  const id = opt(rest, "--trace-id");
8435
8438
  const uri = opt(rest, "--uri");
8439
+ const app = opt(rest, "--app");
8440
+ if (app) body.filters = { service_name: app };
8436
8441
  if (id) body.trace_id = id;
8437
8442
  else if (uri) {
8438
8443
  body.uri = uri;
8439
8444
  body.fuzzy = !flag(rest, "--exact");
8440
8445
  } else {
8441
- console.error("用法:bfi ymc ingress --trace-id <id> | --uri </path> -e <env> [-t time]");
8446
+ console.error("用法:bfi ymc ingress --trace-id <id> | --uri </path> [-app <service_name>] -e <env> [-t time]");
8442
8447
  process.exit(1);
8443
8448
  }
8444
8449
  emit(await api.call("kibana/search", body), jsonMode, rowsSummary("ingress 日志"));
@@ -8741,8 +8746,8 @@ bfi ymc — 观测查询(v2 API:YMC/Kibana/SLS/trace)
8741
8746
  slowcall -t <time> [-e] [--trace-id] [--app] [--method] [--min-cost ms] [--profiler]
8742
8747
  exceptions -t <time> [-e] [--app]
8743
8748
  alerts -t <time> [-e] [--level error|warn|info]
8744
- url-stats </uri> -t <time> -e <env>
8745
- ingress --trace-id <id> | --uri </path> [-t <time>] -e <env> [--exact]
8749
+ url-stats </uri> -t <time> -e <env> [--app <service_name>]
8750
+ ingress --trace-id <id> | --uri </path> [-t <time>] -e <env> [--exact] [--app <service_name>]
8746
8751
  dump-list [-t <time>] -e <env> [--app] [--type profiler]
8747
8752
  cases <search|show|upload|index> 案例库(KEDB)
8748
8753
  wiki search "<kw>" [--source] [--titles] 知识库统一检索(wiki/jira/文库)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bfi-cli",
3
- "version": "0.1.67",
3
+ "version": "0.1.68",
4
4
  "description": "用友大业财BFI统一命令行工具,支持技能,技能包,元数据,UI元数据等",
5
5
  "type": "module",
6
6
  "bin": {