@oneuptime/common 14.1.0 → 14.2.0
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/Models/DatabaseModels/Alert.d.mts +1 -0
- package/Models/DatabaseModels/Alert.d.ts +1 -0
- package/Models/DatabaseModels/Alert.js +34 -0
- package/Models/DatabaseModels/AutoRemediationSuggestion.d.mts +2 -0
- package/Models/DatabaseModels/AutoRemediationSuggestion.d.ts +2 -0
- package/Models/DatabaseModels/AutoRemediationSuggestion.js +62 -0
- package/Models/DatabaseModels/Incident.d.mts +1 -0
- package/Models/DatabaseModels/Incident.d.ts +1 -0
- package/Models/DatabaseModels/Incident.js +35 -0
- package/Models/DatabaseModels/IncidentPostmortemActionItem.d.mts +31 -0
- package/Models/DatabaseModels/IncidentPostmortemActionItem.d.ts +31 -0
- package/Models/DatabaseModels/IncidentPostmortemActionItem.js +591 -0
- package/Models/DatabaseModels/IncidentPostmortemActionItem.mjs +3 -0
- package/Models/DatabaseModels/Index.js +2 -0
- package/Models/DatabaseModels/TelemetryIngestionKey.js +1 -1
- package/Types/AI/AIActionWords.d.mts +3 -1
- package/Types/AI/AIActionWords.d.ts +3 -1
- package/Types/AI/AIActionWords.js +70 -1
- package/Types/AI/AIActionWords.mjs +2 -0
- package/Types/AI/AIChatTypes.d.mts +2 -1
- package/Types/AI/AIChatTypes.d.ts +2 -1
- package/Types/AI/AIReadTableWords.d.mts +192 -0
- package/Types/AI/AIReadTableWords.d.ts +192 -0
- package/Types/AI/AIReadTableWords.js +368 -0
- package/Types/AI/AIReadTableWords.mjs +18 -0
- package/Types/AI/AiRunRefusal.d.mts +3 -0
- package/Types/AI/AiRunRefusal.d.ts +3 -0
- package/Types/AI/AiRunRefusal.js +22 -1
- package/Types/AI/ResourceAiAccessPermissions.js +7 -18
- package/Types/AuditLog/AuditLogActionLabel.js +19 -9
- package/Types/BaseDatabase/AggregationIntervalUtil.d.mts +16 -0
- package/Types/BaseDatabase/AggregationIntervalUtil.d.ts +16 -0
- package/Types/BaseDatabase/AggregationIntervalUtil.js +123 -16
- package/Types/Cloud/CloudResourceHealth.d.mts +30 -1
- package/Types/Cloud/CloudResourceHealth.d.ts +30 -1
- package/Types/Cloud/CloudResourceHealth.js +405 -13
- package/Types/Cloud/CloudResourceHealth.mjs +28 -0
- package/Types/DataObservability/DataCheckRefusals.d.mts +32 -0
- package/Types/DataObservability/DataCheckRefusals.d.ts +32 -0
- package/Types/DataObservability/DataCheckRefusals.js +77 -0
- package/Types/DataObservability/DataCheckRefusals.mjs +8 -0
- package/Types/Database/AccessControl/PermissionScopeNarrowing.js +4 -0
- package/Types/Date.d.mts +2 -0
- package/Types/Date.d.ts +2 -0
- package/Types/Date.js +22 -0
- package/Types/DateLanguage.d.mts +2 -0
- package/Types/DateLanguage.d.ts +2 -0
- package/Types/DateLanguage.js +8 -5
- package/Types/Email/EmailTemplateType.d.mts +1 -0
- package/Types/Email/EmailTemplateType.d.ts +1 -0
- package/Types/Email/EmailTemplateType.js +2 -0
- package/Types/Exception/EgressGuardException.js +1 -1
- package/Types/Exception/ErrorMessageRule.d.mts +1 -0
- package/Types/Exception/ErrorMessageRule.d.ts +1 -0
- package/Types/Exception/ErrorMessageRule.js +67 -13
- package/Types/Exception/ErrorMessageRule.mjs +1 -0
- package/Types/Exception/ExceptionMessages.d.mts +2 -0
- package/Types/Exception/ExceptionMessages.d.ts +2 -0
- package/Types/Exception/ExceptionMessages.js +2 -0
- package/Types/Incident/PostmortemActionItemStatus.d.mts +17 -0
- package/Types/Incident/PostmortemActionItemStatus.d.ts +17 -0
- package/Types/Incident/PostmortemActionItemStatus.js +74 -0
- package/Types/Incident/PostmortemActionItemStatus.mjs +5 -0
- package/Types/JSONFunctions.js +10 -3
- package/Types/Link.d.mts +1 -0
- package/Types/Link.d.ts +1 -0
- package/Types/MeaningKeys.d.mts +4 -0
- package/Types/MeaningKeys.d.ts +4 -0
- package/Types/MeaningKeys.js +74 -0
- package/Types/MeaningKeys.mjs +5 -0
- package/Types/Monitor/WhoIsTold.d.mts +3 -0
- package/Types/Monitor/WhoIsTold.d.ts +3 -0
- package/Types/Monitor/WhoIsTold.js +63 -13
- package/Types/NoBreakSpaces.d.mts +16 -0
- package/Types/NoBreakSpaces.d.ts +16 -0
- package/Types/NoBreakSpaces.js +419 -0
- package/Types/NoBreakSpaces.mjs +9 -0
- package/Types/NotificationRule/PagingLadder.d.mts +12 -0
- package/Types/NotificationRule/PagingLadder.d.ts +12 -0
- package/Types/NotificationRule/PagingLadder.js +159 -11
- package/Types/NotificationRule/PagingLadder.mjs +3 -0
- package/Types/OnCallDutyPolicy/OnCallPageRecordGone.d.mts +3 -0
- package/Types/OnCallDutyPolicy/OnCallPageRecordGone.d.ts +3 -0
- package/Types/OnCallDutyPolicy/OnCallPageRecordGone.js +42 -0
- package/Types/OnCallDutyPolicy/OnCallPageRecordGone.mjs +4 -0
- package/Types/OnCallDutyPolicy/OnCallPageWords.d.mts +6 -2
- package/Types/OnCallDutyPolicy/OnCallPageWords.d.ts +6 -2
- package/Types/OnCallDutyPolicy/OnCallPageWords.js +21 -20
- package/Types/OnCallDutyPolicy/OnCallPersonPage.d.mts +4 -0
- package/Types/OnCallDutyPolicy/OnCallPersonPage.d.ts +4 -0
- package/Types/OnCallDutyPolicy/OnCallPersonPage.js +125 -1
- package/Types/OnCallDutyPolicy/OnCallPersonPage.mjs +1 -0
- package/Types/OnCallDutyPolicy/OnCallTestPage.d.mts +2 -0
- package/Types/OnCallDutyPolicy/OnCallTestPage.d.ts +2 -0
- package/Types/OnCallDutyPolicy/OnCallTestPage.js +12 -0
- package/Types/OnCallDutyPolicy/OnCallTestPage.mjs +1 -0
- package/Types/OpenStack/OpenStackCapacity.js +12 -5
- package/Types/Permission.d.mts +4 -0
- package/Types/Permission.d.ts +4 -0
- package/Types/Permission.js +64 -8
- package/Types/Product/ProductUsage.js +2 -1
- package/Types/Product/ProjectProductsAnswer.js +2 -1
- package/Types/ResourceAiAgent/AiResourceType.d.mts +1 -0
- package/Types/ResourceAiAgent/AiResourceType.d.ts +1 -0
- package/Types/ResourceAiAgent/AiResourceType.js +12 -0
- package/Types/Rum/ProductAnalyticsEventReads.js +10 -1
- package/Types/Rum/ProductAnalyticsEvents.js +13 -1
- package/Types/Rum/SessionReplayCustomEvents.d.mts +4 -1
- package/Types/Rum/SessionReplayCustomEvents.d.ts +4 -1
- package/Types/Rum/SessionReplayCustomEvents.js +12 -0
- package/Types/Rum/SessionReplayCustomEvents.mjs +1 -0
- package/Types/SetupHealth/SetupHealth.d.mts +1 -0
- package/Types/SetupHealth/SetupHealth.d.ts +1 -0
- package/Types/SetupHealth/SetupHealth.js +13 -5
- package/Types/StatusPage/DefaultStatusNames.d.mts +11 -3
- package/Types/StatusPage/DefaultStatusNames.d.ts +11 -3
- package/Types/StatusPage/DefaultStatusNames.js +74 -28
- package/Types/StatusPage/DefaultStatusNames.mjs +9 -2
- package/Types/StatusPage/StateChangeNoteMessage.d.mts +3 -2
- package/Types/StatusPage/StateChangeNoteMessage.d.ts +3 -2
- package/Types/StatusPage/StateChangeNoteMessage.js +16 -13
- package/Types/Telemetry/TelemetryIngestionKeyType.js +7 -6
- package/Types/Translator.d.mts +1 -0
- package/Types/Translator.d.ts +1 -0
- package/Types/Translator.js +100 -19
- package/Types/Translator.mjs +1 -0
- package/Types/UserSession/SessionLength.d.mts +33 -0
- package/Types/UserSession/SessionLength.d.ts +33 -0
- package/Types/UserSession/SessionLength.js +134 -5
- package/Types/UserSession/SessionLength.mjs +5 -0
- package/Types/Workflow/WorkflowStatus.js +21 -10
- package/Utils/AI/InvestigationReport.js +2 -2
- package/Utils/API.d.mts +0 -11
- package/Utils/API.d.ts +0 -11
- package/Utils/API.js +0 -432
- package/Utils/AiRemediation/Resource/ResourceCommandPolicy.js +2 -2
- package/Utils/AiRemediation/VerifiedFixRunbook.d.mts +39 -0
- package/Utils/AiRemediation/VerifiedFixRunbook.d.ts +39 -0
- package/Utils/AiRemediation/VerifiedFixRunbook.js +231 -0
- package/Utils/AiRemediation/VerifiedFixRunbook.mjs +10 -0
- package/Utils/Dashboard/DashboardWidgetSorts.js +11 -2
- package/Utils/Dashboard/MonitorListWidgetFormat.d.mts +2 -1
- package/Utils/Dashboard/MonitorListWidgetFormat.d.ts +2 -1
- package/Utils/Dashboard/MonitorListWidgetFormat.js +5 -3
- package/Utils/DefaultRecordNames.d.mts +6 -0
- package/Utils/DefaultRecordNames.d.ts +6 -0
- package/Utils/DefaultRecordNames.js +122 -0
- package/Utils/DefaultRecordNames.mjs +6 -0
- package/Utils/Grok/Grok.js +7 -4
- package/Utils/Incident/PostmortemActionItemCodeTask.d.mts +20 -0
- package/Utils/Incident/PostmortemActionItemCodeTask.d.ts +20 -0
- package/Utils/Incident/PostmortemActionItemCodeTask.js +107 -0
- package/Utils/Incident/PostmortemActionItemCodeTask.mjs +10 -0
- package/Utils/Incident/PostmortemActionItemMarkdown.d.mts +39 -0
- package/Utils/Incident/PostmortemActionItemMarkdown.d.ts +39 -0
- package/Utils/Incident/PostmortemActionItemMarkdown.js +118 -0
- package/Utils/Incident/PostmortemActionItemMarkdown.mjs +12 -0
- package/Utils/Incident/PostmortemNoteActionItems.d.mts +29 -0
- package/Utils/Incident/PostmortemNoteActionItems.d.ts +29 -0
- package/Utils/Incident/PostmortemNoteActionItems.js +544 -0
- package/Utils/Incident/PostmortemNoteActionItems.mjs +7 -0
- package/Utils/LookupTable.d.mts +3 -0
- package/Utils/LookupTable.d.ts +3 -0
- package/Utils/LookupTable.js +61 -0
- package/Utils/LookupTable.mjs +3 -0
- package/Utils/Markdown/LinkReferenceDefinitions.d.mts +2 -0
- package/Utils/Markdown/LinkReferenceDefinitions.d.ts +2 -0
- package/Utils/Markdown/LinkReferenceDefinitions.js +101 -1
- package/Utils/Markdown/LinkReferenceDefinitions.mjs +2 -0
- package/Utils/Markdown/OverLongText.js +296 -2
- package/Utils/Markdown/SlowMarkdown.d.mts +1 -0
- package/Utils/Markdown/SlowMarkdown.d.ts +1 -0
- package/Utils/Markdown/SlowMarkdown.js +354 -4
- package/Utils/Markdown/SlowMarkdown.mjs +1 -0
- package/Utils/Metrics/MetricFormulaEvaluator.js +10 -4
- package/Utils/Metrics/MetricSeriesFingerprint.js +13 -4
- package/Utils/Metrics/MetricSeriesScope.d.mts +5 -0
- package/Utils/Metrics/MetricSeriesScope.d.ts +5 -0
- package/Utils/Metrics/MetricSeriesScope.js +5 -1
- package/Utils/Monitor/MonitorRootCauseWording.d.mts +3 -0
- package/Utils/Monitor/MonitorRootCauseWording.d.ts +3 -0
- package/Utils/Monitor/MonitorRootCauseWording.js +100 -11
- package/Utils/Monitor/ProbeAgreementRule.d.mts +10 -0
- package/Utils/Monitor/ProbeAgreementRule.d.ts +10 -0
- package/Utils/Monitor/ProbeAgreementRule.js +58 -0
- package/Utils/Monitor/ProbeAgreementRule.mjs +3 -0
- package/Utils/Monitor/ProbeFailureReading.d.mts +4 -0
- package/Utils/Monitor/ProbeFailureReading.d.ts +4 -0
- package/Utils/Monitor/ProbeFailureReading.js +30 -1
- package/Utils/Monitor/ProbeFailureReading.mjs +1 -0
- package/Utils/Monitor/RequestFailureDescriptions.d.mts +61 -0
- package/Utils/Monitor/RequestFailureDescriptions.d.ts +61 -0
- package/Utils/Monitor/RequestFailureDescriptions.js +252 -0
- package/Utils/Monitor/RequestFailureDescriptions.mjs +6 -0
- package/Utils/PromQL/PromQLEngine.js +18 -9
- package/Utils/PromQL/PromQLFunctionEvaluators.js +114 -58
- package/Utils/PromQL/PromQLLabelOrder.d.mts +8 -0
- package/Utils/PromQL/PromQLLabelOrder.d.ts +8 -0
- package/Utils/PromQL/PromQLLabelOrder.js +212 -0
- package/Utils/PromQL/PromQLLabelOrder.mjs +6 -0
- package/Utils/PromQL/PromQLLabels.js +4 -3
- package/Utils/PromQL/PromQLMetricNames.js +8 -2
- package/Utils/PromQL/PromQLParser.js +11 -6
- package/Utils/PromQL/PromQLRegex.d.mts +11 -0
- package/Utils/PromQL/PromQLRegex.d.ts +11 -0
- package/Utils/PromQL/PromQLRegex.js +990 -50
- package/Utils/PromQL/PromQLRegex.mjs +3 -0
- package/Utils/PromQL/PrometheusResponse.js +3 -1
- package/Utils/PromQL/RE2CharacterClass.d.mts +24 -0
- package/Utils/PromQL/RE2CharacterClass.d.ts +24 -0
- package/Utils/PromQL/RE2CharacterClass.js +532 -0
- package/Utils/PromQL/RE2CharacterClass.mjs +16 -0
- package/Utils/RequestFailedDetailsUtil.d.mts +15 -0
- package/Utils/RequestFailedDetailsUtil.d.ts +15 -0
- package/Utils/RequestFailedDetailsUtil.js +452 -0
- package/Utils/RequestFailedDetailsUtil.mjs +2 -0
- package/Utils/Rum/UrlScrubber.d.mts +1 -1
- package/Utils/Rum/UrlScrubber.d.ts +1 -1
- package/Utils/Rum/UrlScrubber.js +10 -4
- package/Utils/Rum/UserFlow.js +22 -4
- package/Utils/SecurityCase/SecurityOverviewMetrics.d.mts +11 -1
- package/Utils/SecurityCase/SecurityOverviewMetrics.d.ts +11 -1
- package/Utils/SecurityCase/SecurityOverviewMetrics.js +99 -17
- package/Utils/SecurityCase/SecurityOverviewMetrics.mjs +3 -0
- package/Utils/Sms/OnCallPageSms.d.mts +2 -0
- package/Utils/Sms/OnCallPageSms.d.ts +2 -0
- package/Utils/Sms/OnCallPageSms.js +3 -1
- package/Utils/StateListType.d.mts +11 -0
- package/Utils/StateListType.d.ts +11 -0
- package/Utils/StateListType.js +21 -0
- package/Utils/StateListType.mjs +2 -0
- package/Utils/StateOrder.d.mts +8 -11
- package/Utils/StateOrder.d.ts +8 -11
- package/Utils/StateOrder.js +49 -84
- package/Utils/StateOrder.mjs +2 -0
- package/Utils/Suggestions/ActionItemCodeTaskSuggestion.d.mts +9 -0
- package/Utils/Suggestions/ActionItemCodeTaskSuggestion.d.ts +9 -0
- package/Utils/Suggestions/ActionItemCodeTaskSuggestion.js +25 -0
- package/Utils/Suggestions/ActionItemCodeTaskSuggestion.mjs +2 -0
- package/Utils/Suggestions/VerifiedFixRunbookSuggestion.d.mts +5 -0
- package/Utils/Suggestions/VerifiedFixRunbookSuggestion.d.ts +5 -0
- package/Utils/Suggestions/VerifiedFixRunbookSuggestion.js +39 -0
- package/Utils/Suggestions/VerifiedFixRunbookSuggestion.mjs +2 -0
- package/Utils/Syslog/SyslogMessageParser.js +16 -6
- package/Utils/Telemetry/HeartbeatAvailability.js +16 -21
- package/Utils/ValueFormatter.d.mts +1 -0
- package/Utils/ValueFormatter.d.ts +1 -0
- package/Utils/ValueFormatter.js +258 -18
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.AggregationIntervalUtil = void 0;
|
|
7
7
|
const AggregationInterval_1 = __importDefault(require("./AggregationInterval"));
|
|
8
8
|
const Date_1 = __importDefault(require("../Date"));
|
|
9
|
+
const Timezone_1 = __importDefault(require("../Timezone"));
|
|
9
10
|
const TimezoneAlias_1 = __importDefault(require("../TimezoneAlias"));
|
|
10
11
|
/*
|
|
11
12
|
* The intervals whose buckets are units of a calendar: a day from midnight,
|
|
@@ -20,6 +21,16 @@ const CALENDAR_INTERVALS = [
|
|
|
20
21
|
AggregationInterval_1.default.Month,
|
|
21
22
|
AggregationInterval_1.default.Year,
|
|
22
23
|
];
|
|
24
|
+
/*
|
|
25
|
+
* The calendar unit each of those buckets is (OneUptimeDate's): a week is
|
|
26
|
+
* an ISO week, from Monday, as the server's toStartOfInterval starts it.
|
|
27
|
+
*/
|
|
28
|
+
const CALENDAR_UNIT_OF_INTERVAL = {
|
|
29
|
+
[AggregationInterval_1.default.Day]: "day",
|
|
30
|
+
[AggregationInterval_1.default.Week]: "week",
|
|
31
|
+
[AggregationInterval_1.default.Month]: "month",
|
|
32
|
+
[AggregationInterval_1.default.Year]: "year",
|
|
33
|
+
};
|
|
23
34
|
/*
|
|
24
35
|
* Single source of truth for "which time-bucket size does the
|
|
25
36
|
* analytics aggregate API use for a given query window". The server
|
|
@@ -87,6 +98,96 @@ class AggregationIntervalUtil {
|
|
|
87
98
|
static isCalendarInterval(interval) {
|
|
88
99
|
return CALENDAR_INTERVALS.includes(interval);
|
|
89
100
|
}
|
|
101
|
+
/*
|
|
102
|
+
* The calendar unit a day, week, month or year bucket is: "day", "week"
|
|
103
|
+
* (from Monday), "month" or "year". Undefined for an hour and shorter,
|
|
104
|
+
* which are fixed lengths of time, and for Total.
|
|
105
|
+
*/
|
|
106
|
+
static getCalendarUnit(interval) {
|
|
107
|
+
return CALENDAR_UNIT_OF_INTERVAL[interval];
|
|
108
|
+
}
|
|
109
|
+
/*
|
|
110
|
+
* The instant a bucket of `interval` starting at `bucketStart` ends: the
|
|
111
|
+
* one the next bucket starts at, which is where a bucket closes (issue
|
|
112
|
+
* #7924). An hour and shorter are their fixed length. A day, a week, a
|
|
113
|
+
* month and a year end where the next one starts on the calendar of
|
|
114
|
+
* `timezone`, the zone the bucket was cut in - its request's
|
|
115
|
+
* AggregateBy.timezone, UTC when it named none: a day is 23 or 25 hours
|
|
116
|
+
* where the clocks change (23.5 or 24.5 on Lord Howe Island), a month 28
|
|
117
|
+
* to 31 days, a year 365 or 366, none of them the nominal width
|
|
118
|
+
* getAggregationIntervalMs gives.
|
|
119
|
+
*
|
|
120
|
+
* The next unit is the one holding the instant one and a half nominal
|
|
121
|
+
* units on from the start of the unit holding `bucketStart`: no real unit
|
|
122
|
+
* is half a nominal one shorter or longer than it, so that instant is in
|
|
123
|
+
* the next unit, never in the one after it. HeartbeatAvailabilityUtil has
|
|
124
|
+
* walked the server's calendar buckets this way since issue #7277.
|
|
125
|
+
*/
|
|
126
|
+
static getBucketEnd(data) {
|
|
127
|
+
const startMs = Date_1.default.fromString(data.bucketStart).getTime();
|
|
128
|
+
const nominalMs = this.getAggregationIntervalMs(data.interval);
|
|
129
|
+
const unit = this.getCalendarUnit(data.interval);
|
|
130
|
+
if (!unit || !Number.isFinite(startMs)) {
|
|
131
|
+
return new Date(startMs + nominalMs);
|
|
132
|
+
}
|
|
133
|
+
/*
|
|
134
|
+
* In its current name, as the server cuts it (AggregateUtil
|
|
135
|
+
* .getBucketTimezone): moment no longer knows US/Pacific-New, and
|
|
136
|
+
* would read its days as UTC's.
|
|
137
|
+
*/
|
|
138
|
+
const timezone = data.timezone
|
|
139
|
+
? TimezoneAlias_1.default.getCanonicalTimezone(data.timezone)
|
|
140
|
+
: Timezone_1.default.UTC;
|
|
141
|
+
const unitStart = Date_1.default.getStartOfCalendarUnit(new Date(startMs), unit, timezone);
|
|
142
|
+
return Date_1.default.getStartOfCalendarUnit(new Date(unitStart.getTime() + nominalMs * 1.5), unit, timezone);
|
|
143
|
+
}
|
|
144
|
+
/*
|
|
145
|
+
* The reader's zone - OneUptimeDate.getCurrentTimezone(): the zone User
|
|
146
|
+
* Settings picked, else the browser's - when the Timezone list names it,
|
|
147
|
+
* else undefined. It is the zone a request from the dashboard asks the
|
|
148
|
+
* server to cut its days in. The server takes no zone the list does not
|
|
149
|
+
* name, and a browser can report one newer than the list, so such a
|
|
150
|
+
* request names none and its days stay UTC's, as before, rather than
|
|
151
|
+
* failing.
|
|
152
|
+
*/
|
|
153
|
+
static getListedReaderTimezone() {
|
|
154
|
+
const timezone = Date_1.default.getCurrentTimezone();
|
|
155
|
+
return TimezoneAlias_1.default.isListedName(timezone) ? timezone : undefined;
|
|
156
|
+
}
|
|
157
|
+
/*
|
|
158
|
+
* The zone a request names for the days a route cuts on the server - an
|
|
159
|
+
* Ask AI question's charts (issue #7922), the Security and Data Security
|
|
160
|
+
* overviews' day bars (issue #7925) - read as the hint it is: its current
|
|
161
|
+
* name (TimezoneAlias) when the Timezone list names it, the rule an
|
|
162
|
+
* aggregate's AggregateBy.timezone is held to (AggregateUtil
|
|
163
|
+
* .readTimezone), and undefined for anything else: nothing, a typo, a
|
|
164
|
+
* zone newer than the list, a number, text written to be SQL. Such a
|
|
165
|
+
* request is answered on UTC's days, as one that names no zone is; the
|
|
166
|
+
* question or the page it asks for is never refused over it.
|
|
167
|
+
*/
|
|
168
|
+
static readRequestedTimezone(value) {
|
|
169
|
+
if (!TimezoneAlias_1.default.isListedName(value)) {
|
|
170
|
+
return undefined;
|
|
171
|
+
}
|
|
172
|
+
return TimezoneAlias_1.default.getCanonicalTimezone(value);
|
|
173
|
+
}
|
|
174
|
+
/*
|
|
175
|
+
* The zone an aggregate over this window asks its buckets to follow, of
|
|
176
|
+
* the one its buckets should follow (`timezone`): that zone when the
|
|
177
|
+
* buckets are days, weeks, months or years and the Timezone list names
|
|
178
|
+
* it, else undefined. An hour and shorter and Total are moved by no zone,
|
|
179
|
+
* so their requests stay exactly as they were, and the server refuses a
|
|
180
|
+
* zone the list does not name, so those buckets follow UTC instead.
|
|
181
|
+
*/
|
|
182
|
+
static getTimezoneForWindow(data) {
|
|
183
|
+
const interval = this.getAggregationIntervalForWindow(data);
|
|
184
|
+
if (!this.isCalendarInterval(interval)) {
|
|
185
|
+
return undefined;
|
|
186
|
+
}
|
|
187
|
+
return TimezoneAlias_1.default.isListedName(data.timezone)
|
|
188
|
+
? data.timezone
|
|
189
|
+
: undefined;
|
|
190
|
+
}
|
|
90
191
|
/*
|
|
91
192
|
* The zone an aggregate over this window asks its buckets to follow: the
|
|
92
193
|
* reader's (OneUptimeDate.getCurrentTimezone(), the zone User Settings
|
|
@@ -101,31 +202,30 @@ class AggregationIntervalUtil {
|
|
|
101
202
|
* follow UTC, as before, rather than the chart failing.
|
|
102
203
|
*/
|
|
103
204
|
static getReaderTimezone(data) {
|
|
104
|
-
|
|
105
|
-
if (!this.isCalendarInterval(interval)) {
|
|
106
|
-
return undefined;
|
|
107
|
-
}
|
|
108
|
-
const timezone = Date_1.default.getCurrentTimezone();
|
|
109
|
-
return TimezoneAlias_1.default.isListedName(timezone) ? timezone : undefined;
|
|
205
|
+
return this.getTimezoneForWindow(Object.assign(Object.assign({}, data), { timezone: Date_1.default.getCurrentTimezone() }));
|
|
110
206
|
}
|
|
111
207
|
/*
|
|
112
|
-
* The request with
|
|
113
|
-
*
|
|
114
|
-
* is. A request that names its zone keeps it - a cloud's cost
|
|
115
|
-
* UTC day, and its readers ask for Timezone.UTC - and one with
|
|
116
|
-
* to read an interval from, or no zone to add, comes back
|
|
208
|
+
* The request with `timezone` on it when its buckets are days, weeks,
|
|
209
|
+
* months or years (getTimezoneForWindow): a new object, the one given
|
|
210
|
+
* left as it is. A request that names its zone keeps it - a cloud's cost
|
|
211
|
+
* is for a UTC day, and its readers ask for Timezone.UTC - and one with
|
|
212
|
+
* no window to read an interval from, or no zone to add, comes back
|
|
213
|
+
* unchanged. The dashboard sends every aggregate with the reader's zone
|
|
214
|
+
* (withReaderTimezone), and Ask AI's tools read theirs with the asker's
|
|
215
|
+
* (ToolContext.readerTimezone, issue #7922).
|
|
117
216
|
*/
|
|
118
|
-
static
|
|
217
|
+
static withTimezone(aggregateBy, timezone) {
|
|
119
218
|
if (!aggregateBy ||
|
|
120
219
|
(aggregateBy.timezone !== undefined && aggregateBy.timezone !== null)) {
|
|
121
220
|
return aggregateBy;
|
|
122
221
|
}
|
|
123
|
-
let
|
|
222
|
+
let bucketTimezone = undefined;
|
|
124
223
|
try {
|
|
125
|
-
|
|
224
|
+
bucketTimezone = this.getTimezoneForWindow({
|
|
126
225
|
startDate: aggregateBy.startTimestamp,
|
|
127
226
|
endDate: aggregateBy.endTimestamp,
|
|
128
227
|
aggregationInterval: aggregateBy.aggregationInterval,
|
|
228
|
+
timezone: timezone,
|
|
129
229
|
});
|
|
130
230
|
}
|
|
131
231
|
catch (_a) {
|
|
@@ -136,10 +236,17 @@ class AggregationIntervalUtil {
|
|
|
136
236
|
*/
|
|
137
237
|
return aggregateBy;
|
|
138
238
|
}
|
|
139
|
-
if (!
|
|
239
|
+
if (!bucketTimezone) {
|
|
140
240
|
return aggregateBy;
|
|
141
241
|
}
|
|
142
|
-
return Object.assign(Object.assign({}, aggregateBy), { timezone:
|
|
242
|
+
return Object.assign(Object.assign({}, aggregateBy), { timezone: bucketTimezone });
|
|
243
|
+
}
|
|
244
|
+
/*
|
|
245
|
+
* The request with the reader's zone on it (getReaderTimezone), as the
|
|
246
|
+
* dashboard sends every aggregate (withTimezone).
|
|
247
|
+
*/
|
|
248
|
+
static withReaderTimezone(aggregateBy) {
|
|
249
|
+
return this.withTimezone(aggregateBy, Date_1.default.getCurrentTimezone());
|
|
143
250
|
}
|
|
144
251
|
/*
|
|
145
252
|
* Nominal bucket width in milliseconds. Month and Year are
|
|
@@ -154,17 +154,19 @@ interface CloudHealthTypeRules {
|
|
|
154
154
|
rules: Array<CloudHealthRule>;
|
|
155
155
|
}
|
|
156
156
|
export declare const CLOUD_HEALTH_RULES: ReadonlyArray<CloudHealthTypeRules>;
|
|
157
|
-
export type CloudHeadlineFormat = "percent" | "ratio" | "bytes" | "count" | "seconds" | "milliseconds" | "perPeriod" | "perSecond";
|
|
157
|
+
export type CloudHeadlineFormat = "percent" | "ratio" | "bytes" | "count" | "seconds" | "milliseconds" | "perPeriod" | "perSecond" | "bytesPerPeriod" | "bytesPerSecond" | "bitsPerSecond";
|
|
158
158
|
export interface CloudHeadlineReading {
|
|
159
159
|
key: string;
|
|
160
160
|
label: string;
|
|
161
161
|
format: CloudHeadlineFormat;
|
|
162
|
+
onlySome?: boolean | undefined;
|
|
162
163
|
}
|
|
163
164
|
interface CloudHeadlineTypeReadings {
|
|
164
165
|
provider: CloudProvider;
|
|
165
166
|
types: Array<string>;
|
|
166
167
|
readings: Array<CloudHeadlineReading>;
|
|
167
168
|
}
|
|
169
|
+
export declare function isCloudHeadlineExpected(headline: CloudHeadlineReading): boolean;
|
|
168
170
|
export declare const HEADLINE_CPU: string;
|
|
169
171
|
export declare const HEADLINE_MEMORY: string;
|
|
170
172
|
export declare const HEADLINE_STORAGE_USED: string;
|
|
@@ -181,6 +183,33 @@ export declare const HEADLINE_OLDEST_MESSAGE: string;
|
|
|
181
183
|
export declare const HEADLINE_UNHEALTHY_HOSTS: string;
|
|
182
184
|
export declare const HEADLINE_AVAILABILITY: string;
|
|
183
185
|
export declare const HEADLINE_SERVER_LOAD: string;
|
|
186
|
+
export declare const HEADLINE_NETWORK_IN: string;
|
|
187
|
+
export declare const HEADLINE_NETWORK_OUT: string;
|
|
188
|
+
export declare const HEADLINE_DISK_READ: string;
|
|
189
|
+
export declare const HEADLINE_DISK_WRITE: string;
|
|
190
|
+
export declare const HEADLINE_FREE_MEMORY: string;
|
|
191
|
+
export declare const HEADLINE_TRAFFIC: string;
|
|
192
|
+
export declare const HEADLINE_THROUGHPUT: string;
|
|
193
|
+
export declare const HEADLINE_HEALTHY_BACKENDS: string;
|
|
194
|
+
export declare const HEADLINE_MESSAGES_IN: string;
|
|
195
|
+
export declare const HEADLINE_MESSAGES_OUT: string;
|
|
196
|
+
export declare const HEADLINE_DEAD_LETTERED: string;
|
|
197
|
+
export declare const HEADLINE_PODS_READY: string;
|
|
198
|
+
export declare const HEADLINE_RESTARTS: string;
|
|
199
|
+
export declare const HEADLINE_REQUEST_UNITS: string;
|
|
200
|
+
export declare const HEADLINE_SESSIONS: string;
|
|
201
|
+
export declare const HEADLINE_READ_OPERATIONS: string;
|
|
202
|
+
export declare const HEADLINE_WRITE_OPERATIONS: string;
|
|
203
|
+
export declare const HEADLINE_READ_LATENCY: string;
|
|
204
|
+
export declare const HEADLINE_WRITE_LATENCY: string;
|
|
205
|
+
export declare const HEADLINE_INSTANCES: string;
|
|
206
|
+
export declare const HEADLINE_CAPACITY: string;
|
|
207
|
+
export declare const HEADLINE_RUNS: string;
|
|
208
|
+
export declare const HEADLINE_FAILED_RUNS: string;
|
|
209
|
+
export declare const HEADLINE_HEALTH: string;
|
|
210
|
+
export declare const HEADLINE_THROTTLED: string;
|
|
211
|
+
export declare const HEADLINE_QUEUE_LENGTH: string;
|
|
212
|
+
export declare const HEADLINE_PORTS_USED: string;
|
|
184
213
|
export declare const CLOUD_HEADLINE_READINGS: ReadonlyArray<CloudHeadlineTypeReadings>;
|
|
185
214
|
export declare function getCloudReadingPeriodSeconds(provider: string, key: string): number;
|
|
186
215
|
export declare function hasCloudHealthRules(provider: string, type: string): boolean;
|
|
@@ -154,17 +154,19 @@ interface CloudHealthTypeRules {
|
|
|
154
154
|
rules: Array<CloudHealthRule>;
|
|
155
155
|
}
|
|
156
156
|
export declare const CLOUD_HEALTH_RULES: ReadonlyArray<CloudHealthTypeRules>;
|
|
157
|
-
export type CloudHeadlineFormat = "percent" | "ratio" | "bytes" | "count" | "seconds" | "milliseconds" | "perPeriod" | "perSecond";
|
|
157
|
+
export type CloudHeadlineFormat = "percent" | "ratio" | "bytes" | "count" | "seconds" | "milliseconds" | "perPeriod" | "perSecond" | "bytesPerPeriod" | "bytesPerSecond" | "bitsPerSecond";
|
|
158
158
|
export interface CloudHeadlineReading {
|
|
159
159
|
key: string;
|
|
160
160
|
label: string;
|
|
161
161
|
format: CloudHeadlineFormat;
|
|
162
|
+
onlySome?: boolean | undefined;
|
|
162
163
|
}
|
|
163
164
|
interface CloudHeadlineTypeReadings {
|
|
164
165
|
provider: CloudProvider;
|
|
165
166
|
types: Array<string>;
|
|
166
167
|
readings: Array<CloudHeadlineReading>;
|
|
167
168
|
}
|
|
169
|
+
export declare function isCloudHeadlineExpected(headline: CloudHeadlineReading): boolean;
|
|
168
170
|
export declare const HEADLINE_CPU: string;
|
|
169
171
|
export declare const HEADLINE_MEMORY: string;
|
|
170
172
|
export declare const HEADLINE_STORAGE_USED: string;
|
|
@@ -181,6 +183,33 @@ export declare const HEADLINE_OLDEST_MESSAGE: string;
|
|
|
181
183
|
export declare const HEADLINE_UNHEALTHY_HOSTS: string;
|
|
182
184
|
export declare const HEADLINE_AVAILABILITY: string;
|
|
183
185
|
export declare const HEADLINE_SERVER_LOAD: string;
|
|
186
|
+
export declare const HEADLINE_NETWORK_IN: string;
|
|
187
|
+
export declare const HEADLINE_NETWORK_OUT: string;
|
|
188
|
+
export declare const HEADLINE_DISK_READ: string;
|
|
189
|
+
export declare const HEADLINE_DISK_WRITE: string;
|
|
190
|
+
export declare const HEADLINE_FREE_MEMORY: string;
|
|
191
|
+
export declare const HEADLINE_TRAFFIC: string;
|
|
192
|
+
export declare const HEADLINE_THROUGHPUT: string;
|
|
193
|
+
export declare const HEADLINE_HEALTHY_BACKENDS: string;
|
|
194
|
+
export declare const HEADLINE_MESSAGES_IN: string;
|
|
195
|
+
export declare const HEADLINE_MESSAGES_OUT: string;
|
|
196
|
+
export declare const HEADLINE_DEAD_LETTERED: string;
|
|
197
|
+
export declare const HEADLINE_PODS_READY: string;
|
|
198
|
+
export declare const HEADLINE_RESTARTS: string;
|
|
199
|
+
export declare const HEADLINE_REQUEST_UNITS: string;
|
|
200
|
+
export declare const HEADLINE_SESSIONS: string;
|
|
201
|
+
export declare const HEADLINE_READ_OPERATIONS: string;
|
|
202
|
+
export declare const HEADLINE_WRITE_OPERATIONS: string;
|
|
203
|
+
export declare const HEADLINE_READ_LATENCY: string;
|
|
204
|
+
export declare const HEADLINE_WRITE_LATENCY: string;
|
|
205
|
+
export declare const HEADLINE_INSTANCES: string;
|
|
206
|
+
export declare const HEADLINE_CAPACITY: string;
|
|
207
|
+
export declare const HEADLINE_RUNS: string;
|
|
208
|
+
export declare const HEADLINE_FAILED_RUNS: string;
|
|
209
|
+
export declare const HEADLINE_HEALTH: string;
|
|
210
|
+
export declare const HEADLINE_THROTTLED: string;
|
|
211
|
+
export declare const HEADLINE_QUEUE_LENGTH: string;
|
|
212
|
+
export declare const HEADLINE_PORTS_USED: string;
|
|
184
213
|
export declare const CLOUD_HEADLINE_READINGS: ReadonlyArray<CloudHeadlineTypeReadings>;
|
|
185
214
|
export declare function getCloudReadingPeriodSeconds(provider: string, key: string): number;
|
|
186
215
|
export declare function hasCloudHealthRules(provider: string, type: string): boolean;
|