-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
Jeongho Nam
committed
Feb 15, 2021
1 parent
3f033ed
commit e76e625
Showing
7 changed files
with
66 additions
and
8 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * as performance from "./performance"; | ||
export * as consumers from "./consumers"; | ||
export * as sellers from "./sellers"; | ||
|
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,32 @@ | ||
import { AesPkcs5 } from "./../../__internal/AesPkcs5"; | ||
import { Fetcher } from "./../../__internal/Fetcher"; | ||
import type { IConnection } from "./../../IConnection"; | ||
import type { Primitive } from "./../../Primitive"; | ||
|
||
import type { IPerformance } from "./../../structures/performance/IMemoryUsage"; | ||
|
||
|
||
// GET performance/ | ||
// PerformanceController.get() | ||
export function get(connection: IConnection, ): Promise<get.Output> | ||
{ | ||
return Fetcher.fetch | ||
( | ||
connection, | ||
{"input_encrypted":false,"output_encrypted":true}, | ||
"GET", | ||
`performance/` | ||
); | ||
} | ||
export namespace get | ||
{ | ||
export type Output = Primitive<IPerformance>; | ||
} | ||
|
||
|
||
|
||
//--------------------------------------------------------- | ||
// TO PREVENT THE UNUSED VARIABLE ERROR | ||
//--------------------------------------------------------- | ||
AesPkcs5; | ||
Fetcher; |
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,5 @@ | ||
export interface IPerformance | ||
{ | ||
cpu: NodeJS.CpuUsage; | ||
memory: NodeJS.MemoryUsage; | ||
} |
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
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,16 @@ | ||
import * as nest from "@nestjs/common"; | ||
import * as helper from "encrypted-nestjs"; | ||
import { IPerformance } from "../../../api/structures/performance/IMemoryUsage"; | ||
|
||
@nest.Controller("performance") | ||
export class PerformanceController | ||
{ | ||
@helper.EncryptedRoute.Get() | ||
public get(): IPerformance | ||
{ | ||
return { | ||
cpu: process.cpuUsage(), | ||
memory: process.memoryUsage() | ||
}; | ||
} | ||
} |