-
-
Notifications
You must be signed in to change notification settings - Fork 581
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
81 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
declare type CpuUsageResponse = { | ||
avg: number; | ||
usages: number[]; | ||
}; | ||
|
||
declare function _exports(sampleTime?: number): Promise<CpuUsageResponse>; | ||
export = _exports; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import os = require("os"); | ||
import type { NodeHealthStatus } from "./service-broker"; | ||
|
||
export function getHealthStatus(): NodeHealthStatus; | ||
|
||
export function getCpuInfo(): NodeHealthStatus["cpu"]; | ||
export function getMemoryInfo(): NodeHealthStatus["mem"]; | ||
export function getOsInfo(): NodeHealthStatus["os"]; | ||
export function getProcessInfo(): NodeHealthStatus["process"]; | ||
export function getClientInfo(): NodeHealthStatus["client"]; | ||
export function getNetworkInterfacesInfo(): NodeHealthStatus["net"]; | ||
export function getDateTimeInfo(): NodeHealthStatus["time"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import type { ServiceSchema, ServiceSettingSchema } from "./service"; | ||
|
||
declare function _exports(): ServiceSchema<ServiceSettingSchema>; | ||
export = _exports; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
declare class Lock { | ||
locked: Map<string, any[]>; | ||
|
||
acquire(key: string, ttl: number): Promise<any>; | ||
isLocked(key: string): boolean; | ||
release(key: string): Promise<void>; | ||
} | ||
|
||
export = Lock; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* Register common OS, process & Moleculer metrics. | ||
*/ | ||
export function registerCommonMetrics(): void; | ||
|
||
/** | ||
* Update common metric values. | ||
* | ||
* @returns {Promise} | ||
*/ | ||
export function updateCommonMetrics(): Promise<void>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import type BaseMetric = require("./types/base"); | ||
|
||
declare class MetricRate { | ||
metric: BaseMetric; | ||
item: Record<string, any>; | ||
min: number; | ||
|
||
constructor(metric: BaseMetric, item: Record<string, any>, min: number); | ||
|
||
rate: number; | ||
lastValue: number; | ||
lastTickTime: number; | ||
value: number; | ||
timer: NodeJS.Timeout; | ||
|
||
update(value: number): void; | ||
tick(): void; | ||
reset(): void; | ||
} | ||
|
||
export = MetricRate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters