@platformatic/basic 3.7.1 → 3.9.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/config.d.ts CHANGED
@@ -297,6 +297,18 @@ export interface PlatformaticBasicConfig {
297
297
  [k: string]: unknown;
298
298
  };
299
299
  };
300
+ verticalScaler?: {
301
+ enabled?: boolean;
302
+ maxTotalWorkers?: number;
303
+ minWorkers?: number;
304
+ maxWorkers?: number;
305
+ scaleUpELU?: number;
306
+ scaleDownELU?: number;
307
+ minELUDiff?: number;
308
+ timeWindowSec?: number;
309
+ cooldownSec?: number;
310
+ scaleIntervalSec?: number;
311
+ };
300
312
  inspectorOptions?: {
301
313
  host?: string;
302
314
  port?: number;
package/index.d.ts CHANGED
@@ -22,6 +22,8 @@ export declare const schemaOptions: Partial<Record<string, unknown>>
22
22
 
23
23
  export class BaseCapability<Config = Record<string, any>, Options = BaseOptions> {
24
24
  basePath: string
25
+ url: string
26
+
25
27
  constructor (
26
28
  type: string,
27
29
  version: string,
@@ -32,6 +34,7 @@ export class BaseCapability<Config = Record<string, any>, Options = BaseOptions>
32
34
 
33
35
  init (): Promise<void>
34
36
  start (options: StartOptions): Promise<void>
37
+ close (): Promise<void>
35
38
  stop (): Promise<void>
36
39
  build (): Promise<void>
37
40
  getUrl (): string
package/lib/capability.js CHANGED
@@ -88,6 +88,8 @@ export class BaseCapability extends EventEmitter {
88
88
  this.subprocessForceClose = false
89
89
  this.subprocessTerminationSignal = 'SIGINT'
90
90
  this.logger = this._initializeLogger()
91
+ // True by default, can be overridden in subclasses. If false, it takes precedence over the runtime configuration
92
+ this.exitOnUnhandledErrors = true
91
93
 
92
94
  // Setup globals
93
95
  this.registerGlobals({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/basic",
3
- "version": "3.7.1",
3
+ "version": "3.9.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -25,10 +25,10 @@
25
25
  "split2": "^4.2.0",
26
26
  "undici": "^7.0.0",
27
27
  "ws": "^8.18.0",
28
- "@platformatic/foundation": "3.7.1",
29
- "@platformatic/metrics": "3.7.1",
30
- "@platformatic/telemetry": "3.7.1",
31
- "@platformatic/itc": "3.7.1"
28
+ "@platformatic/foundation": "3.9.0",
29
+ "@platformatic/itc": "3.9.0",
30
+ "@platformatic/telemetry": "3.9.0",
31
+ "@platformatic/metrics": "3.9.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "cleaner-spec-reporter": "^0.5.0",
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/basic/3.7.1.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/basic/3.9.0.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Basic Config",
5
5
  "type": "object",
@@ -273,8 +273,7 @@
273
273
  {
274
274
  "type": "string"
275
275
  }
276
- ],
277
- "default": 1
276
+ ]
278
277
  },
279
278
  "workersRestartDelay": {
280
279
  "anyOf": [
@@ -1174,6 +1173,55 @@
1174
1173
  ],
1175
1174
  "additionalProperties": false
1176
1175
  },
1176
+ "verticalScaler": {
1177
+ "type": "object",
1178
+ "properties": {
1179
+ "enabled": {
1180
+ "type": "boolean",
1181
+ "default": true
1182
+ },
1183
+ "maxTotalWorkers": {
1184
+ "type": "number",
1185
+ "minimum": 1
1186
+ },
1187
+ "minWorkers": {
1188
+ "type": "number",
1189
+ "minimum": 1
1190
+ },
1191
+ "maxWorkers": {
1192
+ "type": "number",
1193
+ "minimum": 1
1194
+ },
1195
+ "scaleUpELU": {
1196
+ "type": "number",
1197
+ "minimum": 0,
1198
+ "maximum": 1
1199
+ },
1200
+ "scaleDownELU": {
1201
+ "type": "number",
1202
+ "minimum": 0,
1203
+ "maximum": 1
1204
+ },
1205
+ "minELUDiff": {
1206
+ "type": "number",
1207
+ "minimum": 0,
1208
+ "maximum": 1
1209
+ },
1210
+ "timeWindowSec": {
1211
+ "type": "number",
1212
+ "minimum": 0
1213
+ },
1214
+ "cooldownSec": {
1215
+ "type": "number",
1216
+ "minimum": 0
1217
+ },
1218
+ "scaleIntervalSec": {
1219
+ "type": "number",
1220
+ "minimum": 0
1221
+ }
1222
+ },
1223
+ "additionalProperties": false
1224
+ },
1177
1225
  "inspectorOptions": {
1178
1226
  "type": "object",
1179
1227
  "properties": {