@oneuptime/common 14.0.104 → 14.0.105
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/CloudAccount.d.mts +1 -0
- package/Models/DatabaseModels/CloudAccount.d.ts +1 -0
- package/Models/DatabaseModels/CloudAccount.js +21 -0
- package/Models/DatabaseModels/CloudBudget.d.mts +1 -0
- package/Models/DatabaseModels/CloudBudget.d.ts +1 -0
- package/Models/DatabaseModels/CloudBudget.js +38 -3
- package/Models/DatabaseModels/CloudCostRecommendation.d.mts +2 -0
- package/Models/DatabaseModels/CloudCostRecommendation.d.ts +2 -0
- package/Models/DatabaseModels/CloudCostRecommendation.js +30 -2
- package/Models/DatabaseModels/DetectionRule.js +8 -7
- package/Types/AI/ResourceAiAccessApi.d.mts +1 -0
- package/Types/AI/ResourceAiAccessApi.d.ts +1 -0
- package/Types/AI/ResourceAiAccessApi.js +6 -1
- package/Types/AI/ResourceAiAccessApi.mjs +1 -0
- package/Types/AI/ResourceAiAccessPermissions.d.mts +2 -0
- package/Types/AI/ResourceAiAccessPermissions.d.ts +2 -0
- package/Types/AI/ResourceAiAccessPermissions.js +13 -0
- package/Types/AI/ResourceAiAccessPermissions.mjs +2 -0
- package/Types/Cloud/CloudCost.d.mts +8 -0
- package/Types/Cloud/CloudCost.d.ts +8 -0
- package/Types/Cloud/CloudCost.js +37 -0
- package/Types/Cloud/CloudCost.mjs +1 -0
- package/Types/Cloud/CloudCostAnomaly.d.mts +34 -0
- package/Types/Cloud/CloudCostAnomaly.d.ts +34 -0
- package/Types/Cloud/CloudCostAnomaly.js +236 -0
- package/Types/Cloud/CloudCostAnomaly.mjs +18 -0
- package/Types/Cloud/CloudLogGroups.d.mts +6 -1
- package/Types/Cloud/CloudLogGroups.d.ts +6 -1
- package/Types/Cloud/CloudLogGroups.js +59 -3
- package/Types/Cloud/CloudLogGroups.mjs +1 -0
- package/Types/Cloud/CloudPlatform.js +9 -8
- package/Types/Cloud/CloudRightSizing.d.mts +140 -0
- package/Types/Cloud/CloudRightSizing.d.ts +140 -0
- package/Types/Cloud/CloudRightSizing.js +867 -0
- package/Types/Cloud/CloudRightSizing.mjs +53 -0
- package/Types/CloudConnection/CloudAiAgentKey.d.mts +65 -0
- package/Types/CloudConnection/CloudAiAgentKey.d.ts +65 -0
- package/Types/CloudConnection/CloudAiAgentKey.js +289 -0
- package/Types/CloudConnection/CloudAiAgentKey.mjs +18 -0
- package/Types/CloudConnection/CloudAiAgentSetupCommands.d.mts +5 -2
- package/Types/CloudConnection/CloudAiAgentSetupCommands.d.ts +5 -2
- package/Types/CloudConnection/CloudAiAgentSetupCommands.js +114 -43
- package/Types/CloudConnection/CloudAiAgentSetupCommands.mjs +4 -1
- package/Types/CloudConnection/CloudStream.d.mts +4 -0
- package/Types/CloudConnection/CloudStream.d.ts +4 -0
- package/Types/CloudConnection/CloudStream.js +18 -1
- package/Types/CloudConnection/CloudStream.mjs +4 -0
- package/Types/CloudConnection/CloudStreamTemplate.d.mts +2 -0
- package/Types/CloudConnection/CloudStreamTemplate.d.ts +2 -0
- package/Types/CloudConnection/CloudStreamTemplate.js +89 -6
- package/Types/CloudConnection/CloudStreamTemplate.mjs +2 -0
- package/Types/InstallScripts/InstallScripts.js +1 -1
- package/Types/ResourceAiAgent/CloudAiAgentNames.d.mts +6 -0
- package/Types/ResourceAiAgent/CloudAiAgentNames.d.ts +6 -0
- package/Types/ResourceAiAgent/CloudAiAgentNames.js +11 -1
- package/Types/ResourceAiAgent/CloudAiAgentNames.mjs +3 -0
- package/Types/ResourceAiAgent/ResourceAiAccess.d.mts +3 -1
- package/Types/ResourceAiAgent/ResourceAiAccess.d.ts +3 -1
- package/Types/ResourceAiAgent/ResourceAiAccess.js +13 -2
- package/Types/ResourceAiAgent/ResourceAiAccess.mjs +2 -0
- package/Types/SecurityCase/SecurityCaseContext.d.mts +2 -1
- package/Types/SecurityCase/SecurityCaseContext.d.ts +2 -1
- package/Types/SecurityCase/SecurityConnection.d.mts +2 -1
- package/Types/SecurityCase/SecurityConnection.d.ts +2 -1
- package/Types/SecurityEvent/RealTimeDetection.d.mts +14 -5
- package/Types/SecurityEvent/RealTimeDetection.d.ts +14 -5
- package/Types/SecurityEvent/RealTimeDetection.js +75 -25
- package/Types/SecurityEvent/RealTimeDetection.mjs +3 -3
- package/Types/SecurityPlaybook/SecurityPlaybookAction.d.mts +4 -2
- package/Types/SecurityPlaybook/SecurityPlaybookAction.d.ts +4 -2
- package/Types/SecurityPlaybook/SecurityPlaybookAction.js +22 -3
- package/Types/SecurityPlaybook/SecurityPlaybookStep.d.mts +7 -2
- package/Types/SecurityPlaybook/SecurityPlaybookStep.d.ts +7 -2
- package/Types/SecurityPlaybook/SecurityPlaybookStep.js +96 -39
- package/Types/SecurityPlaybook/SecurityPlaybookStep.mjs +2 -0
- package/Types/SecurityPlaybook/SecurityPlaybookStepCondition.d.mts +17 -2
- package/Types/SecurityPlaybook/SecurityPlaybookStepCondition.d.ts +17 -2
- package/Types/SecurityPlaybook/SecurityPlaybookStepCondition.js +174 -33
- package/Types/SecurityPlaybook/SecurityPlaybookStepCondition.mjs +7 -0
- package/Utils/SecurityCase/SecurityCaseMarkdown.d.mts +5 -0
- package/Utils/SecurityCase/SecurityCaseMarkdown.d.ts +5 -0
- package/Utils/SecurityCase/SecurityCaseMarkdown.js +10 -0
- package/Utils/SecurityCase/SecurityCaseMarkdown.mjs +1 -0
- package/Utils/Telemetry/CloudChangeTitle.d.mts +37 -0
- package/Utils/Telemetry/CloudChangeTitle.d.ts +37 -0
- package/Utils/Telemetry/CloudChangeTitle.js +315 -3
- package/Utils/Telemetry/CloudChangeTitle.mjs +13 -0
- package/package.json +1 -1
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CLOUD_COST_ANOMALIES_KEPT = exports.CLOUD_COST_ANOMALIES_PER_DAY = exports.CLOUD_COST_ANOMALY_DAYS_JUDGED = exports.CLOUD_COST_ANOMALY_MIN_SHARE_PERCENT = exports.CLOUD_COST_ANOMALY_MIN_INCREASE = exports.CLOUD_COST_ANOMALY_ACCOUNT_RATIO = exports.CLOUD_COST_ANOMALY_SERVICE_RATIO = exports.CLOUD_COST_ANOMALY_MIN_HISTORY_DAYS = exports.CLOUD_COST_ANOMALY_BASELINE_DAYS = void 0;
|
|
4
|
+
exports.getCloudCostMedian = getCloudCostMedian;
|
|
5
|
+
exports.getCloudCostAnomalyDay = getCloudCostAnomalyDay;
|
|
6
|
+
exports.getCloudCostAnomalyRatio = getCloudCostAnomalyRatio;
|
|
7
|
+
exports.getCloudCostAnomalyIncrease = getCloudCostAnomalyIncrease;
|
|
8
|
+
exports.findCloudCostDayAnomalies = findCloudCostDayAnomalies;
|
|
9
|
+
exports.findCloudCostAnomalies = findCloudCostAnomalies;
|
|
10
|
+
exports.groupCloudCostAnomaliesByDay = groupCloudCostAnomaliesByDay;
|
|
11
|
+
exports.getStartedCloudCostAnomalies = getStartedCloudCostAnomalies;
|
|
12
|
+
const CloudCost_1 = require("./CloudCost");
|
|
13
|
+
/*
|
|
14
|
+
* A DAY THAT COST FAR MORE THAN USUAL.
|
|
15
|
+
*
|
|
16
|
+
* A budget sees a month: by the time a spike - a runaway job, a service
|
|
17
|
+
* left scaled up, a misconfigured export - adds up to a share of a budget,
|
|
18
|
+
* days of it are spent. So after every read of an account's costs, each of
|
|
19
|
+
* its last 14 full days (the days before the newest one read: a cloud
|
|
20
|
+
* reports the newest late and in part, and a part is never a spike) is held
|
|
21
|
+
* to the 14 days before it:
|
|
22
|
+
*
|
|
23
|
+
* - a service whose day cost twice its usual day or more;
|
|
24
|
+
* - the whole account, when its day cost half again its usual or more;
|
|
25
|
+
*
|
|
26
|
+
* each only when it is at least 10 more than usual in the account's
|
|
27
|
+
* currency and 5% of the account's usual day, so a few cents never read as
|
|
28
|
+
* a spike. A day's usual is the median of the 14 days before it - one spike
|
|
29
|
+
* in them moves it little - of the days since the account's first cost: a
|
|
30
|
+
* day before it was read is not a zero, so a day is judged only with 7 of
|
|
31
|
+
* them, and a new account never is. A day with no cost since is a zero, and
|
|
32
|
+
* a service new to the account counts: a whole service appearing is the
|
|
33
|
+
* spike a person most wants to hear of.
|
|
34
|
+
*
|
|
35
|
+
* Kept on the account's cost summary (CloudCostWriter): the newest day
|
|
36
|
+
* first, each day's account first and then its services by how far above
|
|
37
|
+
* usual, at most five a day and twenty in all. Budgets that alert on
|
|
38
|
+
* unusual days alert on each day once (CloudBudgetEvaluator), and Costs
|
|
39
|
+
* lists them. React-free and server-safe.
|
|
40
|
+
*/
|
|
41
|
+
// The days before the one judged that its usual is taken from.
|
|
42
|
+
exports.CLOUD_COST_ANOMALY_BASELINE_DAYS = 14;
|
|
43
|
+
// Of those, the days with a cost an account needs before it is judged.
|
|
44
|
+
exports.CLOUD_COST_ANOMALY_MIN_HISTORY_DAYS = 7;
|
|
45
|
+
// A service's day this many times its usual is unusual.
|
|
46
|
+
exports.CLOUD_COST_ANOMALY_SERVICE_RATIO = 2;
|
|
47
|
+
// The whole account's day this many times its usual is unusual.
|
|
48
|
+
exports.CLOUD_COST_ANOMALY_ACCOUNT_RATIO = 1.5;
|
|
49
|
+
// At least this much more than usual, in the account's currency.
|
|
50
|
+
exports.CLOUD_COST_ANOMALY_MIN_INCREASE = 10;
|
|
51
|
+
// And at least this share of the account's usual day, in percent.
|
|
52
|
+
exports.CLOUD_COST_ANOMALY_MIN_SHARE_PERCENT = 5;
|
|
53
|
+
// The full days judged after a read: the newest one and those before it.
|
|
54
|
+
exports.CLOUD_COST_ANOMALY_DAYS_JUDGED = 14;
|
|
55
|
+
// At most this many of a day are kept on an account's summary.
|
|
56
|
+
exports.CLOUD_COST_ANOMALIES_PER_DAY = 5;
|
|
57
|
+
// And at most this many in all.
|
|
58
|
+
exports.CLOUD_COST_ANOMALIES_KEPT = 20;
|
|
59
|
+
// The median of a set of amounts; 0 for none.
|
|
60
|
+
function getCloudCostMedian(amounts) {
|
|
61
|
+
const sorted = amounts
|
|
62
|
+
.filter((amount) => {
|
|
63
|
+
return Number.isFinite(amount);
|
|
64
|
+
})
|
|
65
|
+
.sort((a, b) => {
|
|
66
|
+
return a - b;
|
|
67
|
+
});
|
|
68
|
+
if (sorted.length === 0) {
|
|
69
|
+
return 0;
|
|
70
|
+
}
|
|
71
|
+
const middle = Math.floor(sorted.length / 2);
|
|
72
|
+
return sorted.length % 2 === 1
|
|
73
|
+
? sorted[middle]
|
|
74
|
+
: (sorted[middle - 1] + sorted[middle]) / 2;
|
|
75
|
+
}
|
|
76
|
+
/*
|
|
77
|
+
* The newest day judged: the full day before the newest one read.
|
|
78
|
+
* Undefined with no day read.
|
|
79
|
+
*/
|
|
80
|
+
function getCloudCostAnomalyDay(latestDay) {
|
|
81
|
+
if (!latestDay) {
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
const latest = (0, CloudCost_1.fromCloudCostDay)(latestDay);
|
|
85
|
+
return Number.isNaN(latest.getTime())
|
|
86
|
+
? undefined
|
|
87
|
+
: (0, CloudCost_1.toCloudCostDay)((0, CloudCost_1.addUtcDays)(latest, -1));
|
|
88
|
+
}
|
|
89
|
+
// How many times its usual a day cost; Infinity for a day with no usual.
|
|
90
|
+
function getCloudCostAnomalyRatio(anomaly) {
|
|
91
|
+
return anomaly.usual > 0 ? anomaly.amount / anomaly.usual : Infinity;
|
|
92
|
+
}
|
|
93
|
+
// How far above its usual a day cost, in its currency.
|
|
94
|
+
function getCloudCostAnomalyIncrease(anomaly) {
|
|
95
|
+
return anomaly.amount - anomaly.usual;
|
|
96
|
+
}
|
|
97
|
+
/*
|
|
98
|
+
* One day's unusual spend against the 14 days before it: the account's
|
|
99
|
+
* own first, then each service's by how far above usual. Nothing for an
|
|
100
|
+
* account without 7 of them since its first cost.
|
|
101
|
+
*/
|
|
102
|
+
function findCloudCostDayAnomalies(data) {
|
|
103
|
+
const judged = (0, CloudCost_1.fromCloudCostDay)(data.day);
|
|
104
|
+
if (Number.isNaN(judged.getTime())) {
|
|
105
|
+
return [];
|
|
106
|
+
}
|
|
107
|
+
// The account's first day with a cost: the days before it were not read.
|
|
108
|
+
let firstCostDay = undefined;
|
|
109
|
+
for (const [day, services] of data.dailyServiceTotals) {
|
|
110
|
+
let total = 0;
|
|
111
|
+
for (const amount of services.values()) {
|
|
112
|
+
total += amount;
|
|
113
|
+
}
|
|
114
|
+
if (total > 0 && (!firstCostDay || day < firstCostDay)) {
|
|
115
|
+
firstCostDay = day;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
const baselineDays = [];
|
|
119
|
+
for (let back = exports.CLOUD_COST_ANOMALY_BASELINE_DAYS; back >= 1; back--) {
|
|
120
|
+
const day = (0, CloudCost_1.toCloudCostDay)((0, CloudCost_1.addUtcDays)(judged, -back));
|
|
121
|
+
if (firstCostDay && day >= firstCostDay) {
|
|
122
|
+
baselineDays.push(day);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
if (baselineDays.length < exports.CLOUD_COST_ANOMALY_MIN_HISTORY_DAYS) {
|
|
126
|
+
return [];
|
|
127
|
+
}
|
|
128
|
+
const dayTotal = (day) => {
|
|
129
|
+
let total = 0;
|
|
130
|
+
for (const amount of (data.dailyServiceTotals.get(day) || new Map()).values()) {
|
|
131
|
+
total += amount;
|
|
132
|
+
}
|
|
133
|
+
return total;
|
|
134
|
+
};
|
|
135
|
+
const accountDays = baselineDays.map(dayTotal);
|
|
136
|
+
const accountUsual = getCloudCostMedian(accountDays);
|
|
137
|
+
const minIncrease = Math.max(exports.CLOUD_COST_ANOMALY_MIN_INCREASE, (accountUsual * exports.CLOUD_COST_ANOMALY_MIN_SHARE_PERCENT) / 100);
|
|
138
|
+
const isUnusual = (check) => {
|
|
139
|
+
return (check.amount >= check.usual * check.ratio &&
|
|
140
|
+
check.amount - check.usual >= minIncrease);
|
|
141
|
+
};
|
|
142
|
+
const anomalies = [];
|
|
143
|
+
const accountAmount = dayTotal(data.day);
|
|
144
|
+
if (isUnusual({
|
|
145
|
+
amount: accountAmount,
|
|
146
|
+
usual: accountUsual,
|
|
147
|
+
ratio: exports.CLOUD_COST_ANOMALY_ACCOUNT_RATIO,
|
|
148
|
+
})) {
|
|
149
|
+
anomalies.push({
|
|
150
|
+
day: data.day,
|
|
151
|
+
service: "",
|
|
152
|
+
amount: (0, CloudCost_1.roundCost)(accountAmount),
|
|
153
|
+
usual: (0, CloudCost_1.roundCost)(accountUsual),
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
const services = [];
|
|
157
|
+
for (const [service, amount] of data.dailyServiceTotals.get(data.day) ||
|
|
158
|
+
new Map()) {
|
|
159
|
+
const usual = getCloudCostMedian(baselineDays.map((day) => {
|
|
160
|
+
var _a;
|
|
161
|
+
return ((_a = data.dailyServiceTotals.get(day)) === null || _a === void 0 ? void 0 : _a.get(service)) || 0;
|
|
162
|
+
}));
|
|
163
|
+
if (isUnusual({ amount, usual, ratio: exports.CLOUD_COST_ANOMALY_SERVICE_RATIO })) {
|
|
164
|
+
services.push({
|
|
165
|
+
day: data.day,
|
|
166
|
+
service,
|
|
167
|
+
amount: (0, CloudCost_1.roundCost)(amount),
|
|
168
|
+
usual: (0, CloudCost_1.roundCost)(usual),
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
services.sort((a, b) => {
|
|
173
|
+
return (getCloudCostAnomalyIncrease(b) - getCloudCostAnomalyIncrease(a) ||
|
|
174
|
+
a.service.localeCompare(b.service));
|
|
175
|
+
});
|
|
176
|
+
return [...anomalies, ...services].slice(0, exports.CLOUD_COST_ANOMALIES_PER_DAY);
|
|
177
|
+
}
|
|
178
|
+
// An account's unusual days: each of its last full days, newest first.
|
|
179
|
+
function findCloudCostAnomalies(data) {
|
|
180
|
+
var _a;
|
|
181
|
+
const newest = getCloudCostAnomalyDay(data.latestDay);
|
|
182
|
+
if (!newest) {
|
|
183
|
+
return [];
|
|
184
|
+
}
|
|
185
|
+
const anomalies = [];
|
|
186
|
+
const newestDate = (0, CloudCost_1.fromCloudCostDay)(newest);
|
|
187
|
+
const days = (_a = data.days) !== null && _a !== void 0 ? _a : exports.CLOUD_COST_ANOMALY_DAYS_JUDGED;
|
|
188
|
+
for (let back = 0; back < days; back++) {
|
|
189
|
+
anomalies.push(...findCloudCostDayAnomalies({
|
|
190
|
+
dailyServiceTotals: data.dailyServiceTotals,
|
|
191
|
+
day: (0, CloudCost_1.toCloudCostDay)((0, CloudCost_1.addUtcDays)(newestDate, -back)),
|
|
192
|
+
}));
|
|
193
|
+
}
|
|
194
|
+
return anomalies.slice(0, exports.CLOUD_COST_ANOMALIES_KEPT);
|
|
195
|
+
}
|
|
196
|
+
/*
|
|
197
|
+
* Unusual days grouped by day, newest first, each day's as kept: what a
|
|
198
|
+
* budget alerts on once a day and Costs lists.
|
|
199
|
+
*/
|
|
200
|
+
function groupCloudCostAnomaliesByDay(anomalies) {
|
|
201
|
+
const byDay = new Map();
|
|
202
|
+
for (const anomaly of anomalies) {
|
|
203
|
+
byDay.set(anomaly.day, [...(byDay.get(anomaly.day) || []), anomaly]);
|
|
204
|
+
}
|
|
205
|
+
return Array.from(byDay.entries())
|
|
206
|
+
.sort((a, b) => {
|
|
207
|
+
return b[0].localeCompare(a[0]);
|
|
208
|
+
})
|
|
209
|
+
.map(([day, entries]) => {
|
|
210
|
+
return { day, anomalies: entries };
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
/*
|
|
214
|
+
* Each day's unusual spend that began that day: a service - or the whole
|
|
215
|
+
* account - that ran high the day before too is the same spike going on,
|
|
216
|
+
* told the day it began. A day left with nothing that began is left out.
|
|
217
|
+
*/
|
|
218
|
+
function getStartedCloudCostAnomalies(groups) {
|
|
219
|
+
const servicesByDay = new Map();
|
|
220
|
+
for (const group of groups) {
|
|
221
|
+
servicesByDay.set(group.day, new Set(group.anomalies.map((anomaly) => {
|
|
222
|
+
return anomaly.service;
|
|
223
|
+
})));
|
|
224
|
+
}
|
|
225
|
+
const started = [];
|
|
226
|
+
for (const group of groups) {
|
|
227
|
+
const dayBefore = servicesByDay.get((0, CloudCost_1.toCloudCostDay)((0, CloudCost_1.addUtcDays)((0, CloudCost_1.fromCloudCostDay)(group.day), -1))) || new Set();
|
|
228
|
+
const anomalies = group.anomalies.filter((anomaly) => {
|
|
229
|
+
return !dayBefore.has(anomaly.service);
|
|
230
|
+
});
|
|
231
|
+
if (anomalies.length > 0) {
|
|
232
|
+
started.push({ day: group.day, anomalies });
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
return started;
|
|
236
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import commonJsModule from "./CloudCostAnomaly.js";
|
|
2
|
+
export const CLOUD_COST_ANOMALIES_KEPT = commonJsModule.CLOUD_COST_ANOMALIES_KEPT;
|
|
3
|
+
export const CLOUD_COST_ANOMALIES_PER_DAY = commonJsModule.CLOUD_COST_ANOMALIES_PER_DAY;
|
|
4
|
+
export const CLOUD_COST_ANOMALY_ACCOUNT_RATIO = commonJsModule.CLOUD_COST_ANOMALY_ACCOUNT_RATIO;
|
|
5
|
+
export const CLOUD_COST_ANOMALY_BASELINE_DAYS = commonJsModule.CLOUD_COST_ANOMALY_BASELINE_DAYS;
|
|
6
|
+
export const CLOUD_COST_ANOMALY_DAYS_JUDGED = commonJsModule.CLOUD_COST_ANOMALY_DAYS_JUDGED;
|
|
7
|
+
export const CLOUD_COST_ANOMALY_MIN_HISTORY_DAYS = commonJsModule.CLOUD_COST_ANOMALY_MIN_HISTORY_DAYS;
|
|
8
|
+
export const CLOUD_COST_ANOMALY_MIN_INCREASE = commonJsModule.CLOUD_COST_ANOMALY_MIN_INCREASE;
|
|
9
|
+
export const CLOUD_COST_ANOMALY_MIN_SHARE_PERCENT = commonJsModule.CLOUD_COST_ANOMALY_MIN_SHARE_PERCENT;
|
|
10
|
+
export const CLOUD_COST_ANOMALY_SERVICE_RATIO = commonJsModule.CLOUD_COST_ANOMALY_SERVICE_RATIO;
|
|
11
|
+
export const findCloudCostAnomalies = commonJsModule.findCloudCostAnomalies;
|
|
12
|
+
export const findCloudCostDayAnomalies = commonJsModule.findCloudCostDayAnomalies;
|
|
13
|
+
export const getCloudCostAnomalyDay = commonJsModule.getCloudCostAnomalyDay;
|
|
14
|
+
export const getCloudCostAnomalyIncrease = commonJsModule.getCloudCostAnomalyIncrease;
|
|
15
|
+
export const getCloudCostAnomalyRatio = commonJsModule.getCloudCostAnomalyRatio;
|
|
16
|
+
export const getCloudCostMedian = commonJsModule.getCloudCostMedian;
|
|
17
|
+
export const getStartedCloudCostAnomalies = commonJsModule.getStartedCloudCostAnomalies;
|
|
18
|
+
export const groupCloudCostAnomaliesByDay = commonJsModule.groupCloudCostAnomaliesByDay;
|
|
@@ -2,16 +2,21 @@ import { CloudMonitoredResource } from "./CloudMonitoredResource.mjs";
|
|
|
2
2
|
export declare const CLOUD_RESOURCE_ID_ATTRIBUTE: string;
|
|
3
3
|
export declare const STORED_CLOUD_RESOURCE_ID_ATTRIBUTE: string;
|
|
4
4
|
export declare const AWS_LOG_GROUP_NAME_MAX_LENGTH: number;
|
|
5
|
+
interface AwsLogGroupPlace {
|
|
6
|
+
accountId: string;
|
|
7
|
+
region: string;
|
|
8
|
+
}
|
|
5
9
|
interface AwsLogGroupRule {
|
|
6
10
|
prefix: string;
|
|
7
11
|
namespace: string;
|
|
8
12
|
type: string;
|
|
9
|
-
read: (parts: Array<string
|
|
13
|
+
read: (parts: Array<string>, place: AwsLogGroupPlace) => {
|
|
10
14
|
dimensions: Record<string, string>;
|
|
11
15
|
region?: string;
|
|
12
16
|
} | null;
|
|
13
17
|
attributes?: ((dimensions: Record<string, string>) => Record<string, string>) | undefined;
|
|
14
18
|
}
|
|
19
|
+
export declare const STATE_MACHINE_LOG_GROUP_SUFFIX: string;
|
|
15
20
|
export declare const AWS_LOG_GROUP_RULES: ReadonlyArray<AwsLogGroupRule>;
|
|
16
21
|
export declare const AWS_LOG_GROUP_RESOURCE_TYPES: ReadonlySet<string>;
|
|
17
22
|
export declare function canCloudResourceHaveStreamedLogs(data: {
|
|
@@ -2,16 +2,21 @@ import { CloudMonitoredResource } from "./CloudMonitoredResource";
|
|
|
2
2
|
export declare const CLOUD_RESOURCE_ID_ATTRIBUTE: string;
|
|
3
3
|
export declare const STORED_CLOUD_RESOURCE_ID_ATTRIBUTE: string;
|
|
4
4
|
export declare const AWS_LOG_GROUP_NAME_MAX_LENGTH: number;
|
|
5
|
+
interface AwsLogGroupPlace {
|
|
6
|
+
accountId: string;
|
|
7
|
+
region: string;
|
|
8
|
+
}
|
|
5
9
|
interface AwsLogGroupRule {
|
|
6
10
|
prefix: string;
|
|
7
11
|
namespace: string;
|
|
8
12
|
type: string;
|
|
9
|
-
read: (parts: Array<string
|
|
13
|
+
read: (parts: Array<string>, place: AwsLogGroupPlace) => {
|
|
10
14
|
dimensions: Record<string, string>;
|
|
11
15
|
region?: string;
|
|
12
16
|
} | null;
|
|
13
17
|
attributes?: ((dimensions: Record<string, string>) => Record<string, string>) | undefined;
|
|
14
18
|
}
|
|
19
|
+
export declare const STATE_MACHINE_LOG_GROUP_SUFFIX: string;
|
|
15
20
|
export declare const AWS_LOG_GROUP_RULES: ReadonlyArray<AwsLogGroupRule>;
|
|
16
21
|
export declare const AWS_LOG_GROUP_RESOURCE_TYPES: ReadonlySet<string>;
|
|
17
22
|
export declare function canCloudResourceHaveStreamedLogs(data: {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AWS_LOG_GROUP_RESOURCE_TYPES = exports.AWS_LOG_GROUP_RULES = exports.AWS_LOG_GROUP_NAME_MAX_LENGTH = exports.STORED_CLOUD_RESOURCE_ID_ATTRIBUTE = exports.CLOUD_RESOURCE_ID_ATTRIBUTE = void 0;
|
|
3
|
+
exports.AWS_LOG_GROUP_RESOURCE_TYPES = exports.AWS_LOG_GROUP_RULES = exports.STATE_MACHINE_LOG_GROUP_SUFFIX = exports.AWS_LOG_GROUP_NAME_MAX_LENGTH = exports.STORED_CLOUD_RESOURCE_ID_ATTRIBUTE = exports.CLOUD_RESOURCE_ID_ATTRIBUTE = void 0;
|
|
4
4
|
exports.canCloudResourceHaveStreamedLogs = canCloudResourceHaveStreamedLogs;
|
|
5
5
|
exports.getAwsLogGroupResource = getAwsLogGroupResource;
|
|
6
6
|
const AwsRegionCode_1 = require("./AwsRegionCode");
|
|
7
7
|
const CloudPlatform_1 = require("./CloudPlatform");
|
|
8
|
+
const CloudResourceCatalog_1 = require("./CloudResourceCatalog");
|
|
8
9
|
const CloudMonitoredResource_1 = require("./CloudMonitoredResource");
|
|
9
10
|
/*
|
|
10
11
|
* WHICH CLOUD RESOURCE A CLOUDWATCH LOGS GROUP IS THE LOG OF.
|
|
@@ -24,7 +25,8 @@ const CloudMonitoredResource_1 = require("./CloudMonitoredResource");
|
|
|
24
25
|
* so they are the function's in Serverless too.
|
|
25
26
|
*
|
|
26
27
|
* A group no rule reads - one a team named itself, an API Gateway's
|
|
27
|
-
* execution log, which names its API by an id no metric carries
|
|
28
|
+
* execution log, which names its API by an id no metric carries, or an ECS
|
|
29
|
+
* task's /ecs/<task definition family>, which names no service - is
|
|
28
30
|
* streamed all the same, under its account and Region, unfiled.
|
|
29
31
|
*
|
|
30
32
|
* Every rule reads the name part by part: no regular expression ever reads
|
|
@@ -73,6 +75,50 @@ function readLambdaFunction(parts) {
|
|
|
73
75
|
}
|
|
74
76
|
return { dimensions: { FunctionName: name } };
|
|
75
77
|
}
|
|
78
|
+
// What the Step Functions console ends a state machine's log group with.
|
|
79
|
+
exports.STATE_MACHINE_LOG_GROUP_SUFFIX = "-Logs";
|
|
80
|
+
// A state machine's name: 1 to 80 of letters, digits, "-" and "_".
|
|
81
|
+
function isStateMachineName(value) {
|
|
82
|
+
if (value.length === 0 || value.length > 80) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
for (const character of value) {
|
|
86
|
+
const isAllowed = (character >= "a" && character <= "z") ||
|
|
87
|
+
(character >= "A" && character <= "Z") ||
|
|
88
|
+
(character >= "0" && character <= "9") ||
|
|
89
|
+
character === "-" ||
|
|
90
|
+
character === "_";
|
|
91
|
+
if (!isAllowed) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
/*
|
|
98
|
+
* The state machine a Step Functions log group is of: the console names it
|
|
99
|
+
* /aws/vendedlogs/states/<state machine>-Logs. The state machine's metrics
|
|
100
|
+
* name it by its ARN, which the group's account and Region complete.
|
|
101
|
+
*/
|
|
102
|
+
function readStateMachine(parts, place) {
|
|
103
|
+
const part = parts[0];
|
|
104
|
+
if (parts.length !== 1 ||
|
|
105
|
+
!part ||
|
|
106
|
+
!part.endsWith(exports.STATE_MACHINE_LOG_GROUP_SUFFIX) ||
|
|
107
|
+
!place.accountId ||
|
|
108
|
+
!(0, AwsRegionCode_1.isAwsRegion)(place.region)) {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
const name = part.slice(0, -exports.STATE_MACHINE_LOG_GROUP_SUFFIX.length);
|
|
112
|
+
if (!isStateMachineName(name)) {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
const region = place.region.toLowerCase();
|
|
116
|
+
return {
|
|
117
|
+
dimensions: {
|
|
118
|
+
StateMachineArn: `arn:${(0, CloudResourceCatalog_1.getAwsPartitionForRegion)(region)}:states:${region}:${place.accountId}:stateMachine:${name}`,
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
}
|
|
76
122
|
exports.AWS_LOG_GROUP_RULES = [
|
|
77
123
|
{
|
|
78
124
|
prefix: "/aws/lambda/",
|
|
@@ -157,6 +203,13 @@ exports.AWS_LOG_GROUP_RULES = [
|
|
|
157
203
|
type: "AWS::ECS::Cluster",
|
|
158
204
|
read: firstPart("ClusterName", 2),
|
|
159
205
|
},
|
|
206
|
+
{
|
|
207
|
+
// The log group the Step Functions console makes for a state machine.
|
|
208
|
+
prefix: "/aws/vendedlogs/states/",
|
|
209
|
+
namespace: "AWS/States",
|
|
210
|
+
type: "AWS::StepFunctions::StateMachine",
|
|
211
|
+
read: readStateMachine,
|
|
212
|
+
},
|
|
160
213
|
];
|
|
161
214
|
// The resource types a stream can deliver logs of.
|
|
162
215
|
exports.AWS_LOG_GROUP_RESOURCE_TYPES = new Set(exports.AWS_LOG_GROUP_RULES.map((rule) => {
|
|
@@ -183,7 +236,10 @@ function getAwsLogGroupResource(data) {
|
|
|
183
236
|
continue;
|
|
184
237
|
}
|
|
185
238
|
const parts = logGroup.slice(rule.prefix.length).split("/");
|
|
186
|
-
const identity = rule.read(parts
|
|
239
|
+
const identity = rule.read(parts, {
|
|
240
|
+
accountId: data.accountId,
|
|
241
|
+
region: data.region,
|
|
242
|
+
});
|
|
187
243
|
if (!identity) {
|
|
188
244
|
return null;
|
|
189
245
|
}
|
|
@@ -3,6 +3,7 @@ export const AWS_LOG_GROUP_NAME_MAX_LENGTH = commonJsModule.AWS_LOG_GROUP_NAME_M
|
|
|
3
3
|
export const AWS_LOG_GROUP_RESOURCE_TYPES = commonJsModule.AWS_LOG_GROUP_RESOURCE_TYPES;
|
|
4
4
|
export const AWS_LOG_GROUP_RULES = commonJsModule.AWS_LOG_GROUP_RULES;
|
|
5
5
|
export const CLOUD_RESOURCE_ID_ATTRIBUTE = commonJsModule.CLOUD_RESOURCE_ID_ATTRIBUTE;
|
|
6
|
+
export const STATE_MACHINE_LOG_GROUP_SUFFIX = commonJsModule.STATE_MACHINE_LOG_GROUP_SUFFIX;
|
|
6
7
|
export const STORED_CLOUD_RESOURCE_ID_ATTRIBUTE = commonJsModule.STORED_CLOUD_RESOURCE_ID_ATTRIBUTE;
|
|
7
8
|
export const canCloudResourceHaveStreamedLogs = commonJsModule.canCloudResourceHaveStreamedLogs;
|
|
8
9
|
export const getAwsLogGroupResource = commonJsModule.getAwsLogGroupResource;
|
|
@@ -32,6 +32,7 @@ exports.getCloudProviderLabel = getCloudProviderLabel;
|
|
|
32
32
|
exports.buildCloudEnvironmentKey = buildCloudEnvironmentKey;
|
|
33
33
|
exports.parseCloudEnvironmentKey = parseCloudEnvironmentKey;
|
|
34
34
|
exports.buildCloudEnvironmentName = buildCloudEnvironmentName;
|
|
35
|
+
const Translator_1 = require("../Translator");
|
|
35
36
|
var CloudProvider;
|
|
36
37
|
(function (CloudProvider) {
|
|
37
38
|
CloudProvider["AWS"] = "aws";
|
|
@@ -80,7 +81,7 @@ exports.MANAGED_CLOUD_PLATFORMS = [
|
|
|
80
81
|
provider: CloudProvider.AWS,
|
|
81
82
|
label: "AWS ECS",
|
|
82
83
|
productName: "AWS ECS / Fargate",
|
|
83
|
-
description: "Tasks on Amazon Elastic Container Service, on Fargate or EC2 launch types.",
|
|
84
|
+
description: (0, Translator_1.translationKey)("Tasks on Amazon Elastic Container Service, on Fargate or EC2 launch types."),
|
|
84
85
|
docsUrl: "/docs/telemetry/cloud-aws-ecs",
|
|
85
86
|
detection: "detector",
|
|
86
87
|
instanceAttribute: "aws.ecs.task.arn",
|
|
@@ -98,7 +99,7 @@ exports.MANAGED_CLOUD_PLATFORMS = [
|
|
|
98
99
|
provider: CloudProvider.AWS,
|
|
99
100
|
label: "AWS Elastic Beanstalk",
|
|
100
101
|
productName: "AWS Elastic Beanstalk",
|
|
101
|
-
description: "Environments managed by AWS Elastic Beanstalk.",
|
|
102
|
+
description: (0, Translator_1.translationKey)("Environments managed by AWS Elastic Beanstalk."),
|
|
102
103
|
docsUrl: "/docs/telemetry/cloud-other-platforms",
|
|
103
104
|
detection: "detector",
|
|
104
105
|
instanceAttribute: "host.id",
|
|
@@ -113,7 +114,7 @@ exports.MANAGED_CLOUD_PLATFORMS = [
|
|
|
113
114
|
provider: CloudProvider.AWS,
|
|
114
115
|
label: "AWS App Runner",
|
|
115
116
|
productName: "AWS App Runner",
|
|
116
|
-
description: "Services running on AWS App Runner.",
|
|
117
|
+
description: (0, Translator_1.translationKey)("Services running on AWS App Runner."),
|
|
117
118
|
docsUrl: "/docs/telemetry/cloud-other-platforms",
|
|
118
119
|
detection: "manual",
|
|
119
120
|
instanceAttribute: "host.name",
|
|
@@ -126,7 +127,7 @@ exports.MANAGED_CLOUD_PLATFORMS = [
|
|
|
126
127
|
provider: CloudProvider.GCP,
|
|
127
128
|
label: "GCP Cloud Run",
|
|
128
129
|
productName: "Google Cloud Run",
|
|
129
|
-
description: "Cloud Run services and jobs.",
|
|
130
|
+
description: (0, Translator_1.translationKey)("Cloud Run services and jobs."),
|
|
130
131
|
docsUrl: "/docs/telemetry/cloud-gcp-cloud-run",
|
|
131
132
|
detection: "detector",
|
|
132
133
|
instanceAttribute: "faas.instance",
|
|
@@ -140,7 +141,7 @@ exports.MANAGED_CLOUD_PLATFORMS = [
|
|
|
140
141
|
provider: CloudProvider.GCP,
|
|
141
142
|
label: "GCP App Engine",
|
|
142
143
|
productName: "Google App Engine",
|
|
143
|
-
description: "App Engine standard and flexible environments.",
|
|
144
|
+
description: (0, Translator_1.translationKey)("App Engine standard and flexible environments."),
|
|
144
145
|
docsUrl: "/docs/telemetry/cloud-other-platforms",
|
|
145
146
|
detection: "detector",
|
|
146
147
|
instanceAttribute: "faas.instance",
|
|
@@ -154,7 +155,7 @@ exports.MANAGED_CLOUD_PLATFORMS = [
|
|
|
154
155
|
provider: CloudProvider.Azure,
|
|
155
156
|
label: "Azure Container Apps",
|
|
156
157
|
productName: "Azure Container Apps",
|
|
157
|
-
description: "Container Apps replicas in a Container Apps environment.",
|
|
158
|
+
description: (0, Translator_1.translationKey)("Container Apps replicas in a Container Apps environment."),
|
|
158
159
|
docsUrl: "/docs/telemetry/cloud-azure-container-apps",
|
|
159
160
|
/*
|
|
160
161
|
* The Collector's `azurecontainerapps` detector and the Node / .NET
|
|
@@ -177,7 +178,7 @@ exports.MANAGED_CLOUD_PLATFORMS = [
|
|
|
177
178
|
provider: CloudProvider.Azure,
|
|
178
179
|
label: "Azure Container Instances",
|
|
179
180
|
productName: "Azure Container Instances",
|
|
180
|
-
description: "Container groups on Azure Container Instances.",
|
|
181
|
+
description: (0, Translator_1.translationKey)("Container groups on Azure Container Instances."),
|
|
181
182
|
docsUrl: "/docs/telemetry/cloud-other-platforms",
|
|
182
183
|
detection: "manual",
|
|
183
184
|
instanceAttribute: "host.name",
|
|
@@ -190,7 +191,7 @@ exports.MANAGED_CLOUD_PLATFORMS = [
|
|
|
190
191
|
provider: CloudProvider.Azure,
|
|
191
192
|
label: "Azure App Service",
|
|
192
193
|
productName: "Azure App Service",
|
|
193
|
-
description: "Web apps on Azure App Service.",
|
|
194
|
+
description: (0, Translator_1.translationKey)("Web apps on Azure App Service."),
|
|
194
195
|
docsUrl: "/docs/telemetry/cloud-other-platforms",
|
|
195
196
|
detection: "detector",
|
|
196
197
|
instanceAttribute: "host.id",
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { CloudSavingKind } from "./CloudCost.mjs";
|
|
2
|
+
import { CloudProvider } from "./CloudPlatform.mjs";
|
|
3
|
+
export declare const CLOUD_RIGHT_SIZING_WINDOW_DAYS: number;
|
|
4
|
+
export declare const CLOUD_RIGHT_SIZING_MIN_OBSERVED_HOURS: number;
|
|
5
|
+
export declare const CLOUD_RIGHT_SIZING_MIN_SAMPLES: number;
|
|
6
|
+
export declare const CLOUD_RIGHT_SIZING_CPU_TARGET_PERCENT: number;
|
|
7
|
+
export declare const CLOUD_RIGHT_SIZING_CPU_PEAK_PERCENT: number;
|
|
8
|
+
export declare const CLOUD_RIGHT_SIZING_MEMORY_TARGET_PERCENT: number;
|
|
9
|
+
export declare const CLOUD_RIGHT_SIZING_CPU_HOT_PERCENT: number;
|
|
10
|
+
export declare const CLOUD_RIGHT_SIZING_MEMORY_HOT_PERCENT: number;
|
|
11
|
+
export declare const CLOUD_RIGHT_SIZING_MAX_STEPS_DOWN: number;
|
|
12
|
+
export declare const CLOUD_DAYS_IN_AVERAGE_MONTH: number;
|
|
13
|
+
export declare const CLOUD_SAVINGS_SOURCE_ONEUPTIME: string;
|
|
14
|
+
export declare const CLOUD_RIGHT_SIZING_RECOMMENDATION_PREFIX: string;
|
|
15
|
+
export declare function getCloudRightSizingRecommendationId(cloudResourceId: string): string;
|
|
16
|
+
export declare function isCloudRightSizingRecommendationId(recommendationId: string | null | undefined): boolean;
|
|
17
|
+
export declare const CLOUD_SIZE_RECOMMENDATION_KINDS: ReadonlyArray<CloudSavingKind>;
|
|
18
|
+
export declare function isRecommenderSizeRecommendation(data: {
|
|
19
|
+
kind: string | null | undefined;
|
|
20
|
+
recommendationId: string | null | undefined;
|
|
21
|
+
}): boolean;
|
|
22
|
+
export declare enum CloudSizeLadder {
|
|
23
|
+
Aws = "aws",
|
|
24
|
+
AzureVm = "azure-vm",
|
|
25
|
+
AzureAppServicePlan = "azure-app-service-plan",
|
|
26
|
+
GcpMachine = "gcp-machine",
|
|
27
|
+
GcpCloudSql = "gcp-cloud-sql"
|
|
28
|
+
}
|
|
29
|
+
export interface CloudRightSizingMetric {
|
|
30
|
+
names: Array<string>;
|
|
31
|
+
toPercent: number;
|
|
32
|
+
}
|
|
33
|
+
export interface CloudRightSizingProfile {
|
|
34
|
+
provider: CloudProvider;
|
|
35
|
+
type: string;
|
|
36
|
+
sizeProperty: string;
|
|
37
|
+
ladder: CloudSizeLadder;
|
|
38
|
+
cpu: CloudRightSizingMetric;
|
|
39
|
+
memory: CloudRightSizingMetric | null;
|
|
40
|
+
memoryNotRead?: string | undefined;
|
|
41
|
+
billHoldsMoreThanSize: boolean;
|
|
42
|
+
savingResourceType: string;
|
|
43
|
+
}
|
|
44
|
+
export declare const MEMORY_NEEDS_CLOUDWATCH_AGENT: string;
|
|
45
|
+
export declare const MEMORY_REPORTED_AS_FREE: string;
|
|
46
|
+
export declare const MEMORY_NEEDS_OPS_AGENT: string;
|
|
47
|
+
export declare const MEMORY_NOT_REPORTED: string;
|
|
48
|
+
export declare const CLOUD_RIGHT_SIZING_PROFILES: ReadonlyArray<CloudRightSizingProfile>;
|
|
49
|
+
export declare function getCloudRightSizingProfile(provider: string | null | undefined, type: string | null | undefined): CloudRightSizingProfile | null;
|
|
50
|
+
export declare function readCloudResourceSize(profile: CloudRightSizingProfile, properties: unknown): string | null;
|
|
51
|
+
export interface CloudSizeSteps {
|
|
52
|
+
isKnown: boolean;
|
|
53
|
+
isBurstable: boolean;
|
|
54
|
+
smaller: string | null;
|
|
55
|
+
larger: string | null;
|
|
56
|
+
}
|
|
57
|
+
export declare function getCloudSizeSteps(ladder: CloudSizeLadder, size: string | null | undefined): CloudSizeSteps;
|
|
58
|
+
export declare enum CloudRightSizingVerdict {
|
|
59
|
+
Overprovisioned = "overprovisioned",
|
|
60
|
+
Underprovisioned = "underprovisioned",
|
|
61
|
+
RightSized = "right-sized",
|
|
62
|
+
NotEnoughHistory = "not-enough-history",
|
|
63
|
+
NotSized = "not-sized"
|
|
64
|
+
}
|
|
65
|
+
export declare enum CloudRightSizingSkipReason {
|
|
66
|
+
SizeNotKnown = "size-not-known",
|
|
67
|
+
Burstable = "burstable",
|
|
68
|
+
SizeNotOnLadder = "size-not-on-ladder"
|
|
69
|
+
}
|
|
70
|
+
export interface CloudUsageObservation {
|
|
71
|
+
cpuP95Percent: number | null;
|
|
72
|
+
cpuMaxPercent: number | null;
|
|
73
|
+
memoryPeakPercent: number | null;
|
|
74
|
+
samples: number;
|
|
75
|
+
observedHours: number;
|
|
76
|
+
}
|
|
77
|
+
export interface CloudResourceDailyCost {
|
|
78
|
+
amount: number;
|
|
79
|
+
currency: string;
|
|
80
|
+
days: number;
|
|
81
|
+
}
|
|
82
|
+
export interface CloudRightSizing {
|
|
83
|
+
verdict: CloudRightSizingVerdict;
|
|
84
|
+
skipReason?: CloudRightSizingSkipReason | undefined;
|
|
85
|
+
currentSize: string | null;
|
|
86
|
+
recommendedSize: string | null;
|
|
87
|
+
factor: number;
|
|
88
|
+
cpuP95Percent: number | null;
|
|
89
|
+
cpuMaxPercent: number | null;
|
|
90
|
+
memoryPeakPercent: number | null;
|
|
91
|
+
isMemoryRead: boolean;
|
|
92
|
+
memoryNotRead?: string | undefined;
|
|
93
|
+
observedDays: number;
|
|
94
|
+
samples: number;
|
|
95
|
+
projectedCpuP95Percent: number | null;
|
|
96
|
+
projectedMemoryPeakPercent: number | null;
|
|
97
|
+
monthlyCost: number | null;
|
|
98
|
+
currency: string | null;
|
|
99
|
+
monthlySavings: number;
|
|
100
|
+
monthlyIncrease: number;
|
|
101
|
+
isSavingUpperBound: boolean;
|
|
102
|
+
}
|
|
103
|
+
export declare function buildCloudRightSizing(data: {
|
|
104
|
+
profile: CloudRightSizingProfile;
|
|
105
|
+
size: string | null;
|
|
106
|
+
observation: CloudUsageObservation;
|
|
107
|
+
dailyCost?: CloudResourceDailyCost | null | undefined;
|
|
108
|
+
}): CloudRightSizing;
|
|
109
|
+
export declare function hasCloudRightSizingChange(sizing: CloudRightSizing): boolean;
|
|
110
|
+
export declare function getCloudReadingsP95(readings: Array<number>): number | null;
|
|
111
|
+
export interface CloudRightSizingEvidence {
|
|
112
|
+
cpuP95Percent: number | null;
|
|
113
|
+
cpuMaxPercent: number | null;
|
|
114
|
+
memoryPeakPercent: number | null;
|
|
115
|
+
observedDays: number;
|
|
116
|
+
factor: number;
|
|
117
|
+
isSavingUpperBound: boolean;
|
|
118
|
+
}
|
|
119
|
+
export declare function toCloudRightSizingEvidence(sizing: CloudRightSizing): CloudRightSizingEvidence;
|
|
120
|
+
export declare function readCloudRightSizingEvidence(value: unknown): CloudRightSizingEvidence | null;
|
|
121
|
+
export declare const RIGHT_SIZING_TITLE: string;
|
|
122
|
+
export declare const CLOUD_RIGHT_SIZING_VERDICT_LABELS: Readonly<Record<CloudRightSizingVerdict, string>>;
|
|
123
|
+
export declare const RIGHT_SIZING_HALF_SIZE: string;
|
|
124
|
+
export declare const RIGHT_SIZING_QUARTER_SIZE: string;
|
|
125
|
+
export declare const RIGHT_SIZING_TWICE_SIZE: string;
|
|
126
|
+
export declare const RIGHT_SIZING_NO_SMALLER_SIZE: string;
|
|
127
|
+
export declare const RIGHT_SIZING_NO_LARGER_SIZE: string;
|
|
128
|
+
export declare const RIGHT_SIZING_FITS: string;
|
|
129
|
+
export declare const RIGHT_SIZING_AT_NEW_SIZE: string;
|
|
130
|
+
export declare const RIGHT_SIZING_AT_NEW_SIZE_WITH_MEMORY: string;
|
|
131
|
+
export declare const RIGHT_SIZING_SAVES: string;
|
|
132
|
+
export declare const RIGHT_SIZING_SAVES_UP_TO: string;
|
|
133
|
+
export declare const RIGHT_SIZING_COSTS_MORE: string;
|
|
134
|
+
export declare const RIGHT_SIZING_SAVING_NOT_KNOWN: string;
|
|
135
|
+
export declare const RIGHT_SIZING_LEARNING: string;
|
|
136
|
+
export declare const RIGHT_SIZING_CPU_P95_LABEL: string;
|
|
137
|
+
export declare const RIGHT_SIZING_CPU_MAX_LABEL: string;
|
|
138
|
+
export declare const RIGHT_SIZING_MEMORY_PEAK_LABEL: string;
|
|
139
|
+
export declare const RIGHT_SIZING_DAYS_READ_LABEL: string;
|
|
140
|
+
export declare const RIGHT_SIZING_NOT_READ: string;
|