bfi-cli 0.1.85 → 0.1.86
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.
- package/dist/cli.mjs +31 -0
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -9099,6 +9099,10 @@ function printHelp$1() {
|
|
|
9099
9099
|
bfi event record <dc> <date> --source-id S --event-type ET --node-code N --ds-code DS [--record-status fail] [--record-id ID] [--tenant-code T] [--size ≤20]
|
|
9100
9100
|
bfi event content <dc> <date> --event-id E --ds-code DS --tenant-code T
|
|
9101
9101
|
bfi event dclist <dc>
|
|
9102
|
+
bfi event analyze-alert <dc> <date> --event-type ET --node-code N [--source-id S] [--tenant-code T]
|
|
9103
|
+
告警编排分析(一次调用:主数据→分库明细→去重采样→traceId→链路→结构化证据包)
|
|
9104
|
+
bfi event slow-consume <dc> [--days ≤7] [--event-type ET] [--node-code N] [--tenant-id T]
|
|
9105
|
+
慢消费分析(一次调用:SLS 慢日志→事件提取→租户聚合→链路→结构化汇总)
|
|
9102
9106
|
全局: --json / --dry-run / --token <tok>
|
|
9103
9107
|
|
|
9104
9108
|
示例:
|
|
@@ -9129,6 +9133,33 @@ async function runEvent(args, globalOpts) {
|
|
|
9129
9133
|
const call = async (path, body) => emit(await api.call(path, body), jsonMode);
|
|
9130
9134
|
const num = (name, dflt) => Number(opt(rest, name) ?? dflt);
|
|
9131
9135
|
const str = (name) => opt(rest, name);
|
|
9136
|
+
if (sub === "analyze-alert") {
|
|
9137
|
+
const dc = reqs[0] ?? missing("<dc>");
|
|
9138
|
+
const date = reqs[1] ?? missing("<date>");
|
|
9139
|
+
const eventType = str("--event-type");
|
|
9140
|
+
const nodeCode = str("--node-code");
|
|
9141
|
+
if (!eventType) missing("--event-type");
|
|
9142
|
+
if (!nodeCode) missing("--node-code");
|
|
9143
|
+
await call("event/analyze-alert", {
|
|
9144
|
+
dc,
|
|
9145
|
+
date,
|
|
9146
|
+
event_type: eventType,
|
|
9147
|
+
node_code: nodeCode,
|
|
9148
|
+
source_id: str("--source-id") ?? "",
|
|
9149
|
+
tenant_code: str("--tenant-code") ?? ""
|
|
9150
|
+
});
|
|
9151
|
+
return;
|
|
9152
|
+
}
|
|
9153
|
+
if (sub === "slow-consume") {
|
|
9154
|
+
await call("event/slow-consume", {
|
|
9155
|
+
dc: reqs[0] ?? missing("<dc>"),
|
|
9156
|
+
days: num("--days", 7),
|
|
9157
|
+
event_type: str("--event-type") ?? "",
|
|
9158
|
+
node_code: str("--node-code") ?? "",
|
|
9159
|
+
tenant_id: str("--tenant-id") ?? ""
|
|
9160
|
+
});
|
|
9161
|
+
return;
|
|
9162
|
+
}
|
|
9132
9163
|
if (sub === "monitor") {
|
|
9133
9164
|
const metric = reqs[0];
|
|
9134
9165
|
if (!metric || !METRICS.includes(metric)) {
|
package/package.json
CHANGED