@lark-apaas/miaoda-cli 0.1.2-alpha.b2b5ae5 → 0.1.2-alpha.c7d0c89
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.
|
@@ -42,6 +42,8 @@ const GRANULARITY_TO_UNIT = {
|
|
|
42
42
|
day: "DAY",
|
|
43
43
|
daily: "DAY",
|
|
44
44
|
"1d": "DAY",
|
|
45
|
+
"1h": "HOUR",
|
|
46
|
+
hour: "HOUR",
|
|
45
47
|
week: "WEEK",
|
|
46
48
|
weekly: "WEEK",
|
|
47
49
|
"1w": "WEEK",
|
|
@@ -72,9 +74,8 @@ async function handleObservabilityAnalytics(opts) {
|
|
|
72
74
|
const timeAggregationUnit = opts.granularity
|
|
73
75
|
? (GRANULARITY_TO_UNIT[opts.granularity] ?? opts.granularity.toUpperCase())
|
|
74
76
|
: "DAY";
|
|
75
|
-
// until 按 timeAggregationUnit 桶向上对齐,避免末桶数据丢失;since 保持原值。
|
|
76
77
|
const nowMs = Date.now();
|
|
77
|
-
const sinceMs = (0, helpers_1.parseToMs)(opts.since) ?? nowMs -
|
|
78
|
+
const sinceMs = (0, helpers_1.parseToMs)(opts.since) ?? nowMs - 30 * 86_400_000;
|
|
78
79
|
const untilMs = (0, helpers_1.parseToMs)(opts.until) ?? nowMs;
|
|
79
80
|
const bucket = timeAggregationUnit;
|
|
80
81
|
const fieldFilters = (0, helpers_1.buildFieldFilters)([
|