mirror of
https://github.com/datarhei/core.git
synced 2025-10-04 23:53:12 +08:00
Add GPU usage in cluster about API endpoint
This commit is contained in:
@@ -171,7 +171,7 @@ func (a *api) Version(c echo.Context) error {
|
|||||||
// @Tags v1.0.0
|
// @Tags v1.0.0
|
||||||
// @ID cluster-1-about
|
// @ID cluster-1-about
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Success 200 {string} About
|
// @Success 200 {object} client.AboutResponse
|
||||||
// @Success 500 {object} Error
|
// @Success 500 {object} Error
|
||||||
// @Router /v1/about [get]
|
// @Router /v1/about [get]
|
||||||
func (a *api) About(c echo.Context) error {
|
func (a *api) About(c echo.Context) error {
|
||||||
@@ -413,7 +413,7 @@ func (a *api) ProcessAdd(c echo.Context) error {
|
|||||||
// @Param id path string true "Process ID"
|
// @Param id path string true "Process ID"
|
||||||
// @Param domain query string false "Domain to act on"
|
// @Param domain query string false "Domain to act on"
|
||||||
// @Param X-Cluster-Origin header string false "Origin ID of request"
|
// @Param X-Cluster-Origin header string false "Origin ID of request"
|
||||||
// @Success 200 {string} string
|
// @Success 200 {object} client.GetProcessResponse
|
||||||
// @Failure 404 {object} Error
|
// @Failure 404 {object} Error
|
||||||
// @Failure 500 {object} Error
|
// @Failure 500 {object} Error
|
||||||
// @Failure 508 {object} Error
|
// @Failure 508 {object} Error
|
||||||
|
@@ -65,7 +65,7 @@ const docTemplateClusterAPI = `{
|
|||||||
"200": {
|
"200": {
|
||||||
"description": "OK",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/client.AboutResponse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"500": {
|
"500": {
|
||||||
@@ -803,7 +803,7 @@ const docTemplateClusterAPI = `{
|
|||||||
"200": {
|
"200": {
|
||||||
"description": "OK",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/client.GetProcessResponse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"404": {
|
"404": {
|
||||||
@@ -1430,6 +1430,111 @@ const docTemplateClusterAPI = `{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"client.AboutResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"address": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"resources": {
|
||||||
|
"$ref": "#/definitions/client.AboutResponseResources"
|
||||||
|
},
|
||||||
|
"started_at": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"version": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"client.AboutResponseGPUResources": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"decoder": {
|
||||||
|
"description": "Current decoder usage, 0-100",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"encoder": {
|
||||||
|
"description": "Current encoder usage, 0-100",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"memory_bytes": {
|
||||||
|
"description": "Currently used memory in bytes",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"memory_limit_bytes": {
|
||||||
|
"description": "Defined memory limit in bytes",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"memory_total_bytes": {
|
||||||
|
"description": "Total available memory in bytes",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"usage": {
|
||||||
|
"description": "Current general usage, 0-100",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"usage_limit": {
|
||||||
|
"description": "Defined general usage limit, 0-100",
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"client.AboutResponseResources": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"cpu": {
|
||||||
|
"description": "Current CPU load, 0-100*ncpu",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"cpu_core": {
|
||||||
|
"description": "Current CPU load of the core itself, 0-100*ncpu",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"cpu_limit": {
|
||||||
|
"description": "Defined CPU load limit, 0-100*ncpu",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"error": {
|
||||||
|
"description": "Last error",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"gpu": {
|
||||||
|
"description": "Currently used GPU resources",
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/client.AboutResponseGPUResources"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"is_throttling": {
|
||||||
|
"description": "Whether this core is currently throttling",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"memory_bytes": {
|
||||||
|
"description": "Currently used memory in bytes",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"memory_core_bytes": {
|
||||||
|
"description": "Current used memory of the core itself in bytes",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"memory_limit_bytes": {
|
||||||
|
"description": "Defined memory limit in bytes",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"memory_total_bytes": {
|
||||||
|
"description": "Total available memory in bytes",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"ncpu": {
|
||||||
|
"description": "Number of CPU on this node",
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"client.AddIdentityRequest": {
|
"client.AddIdentityRequest": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -1446,6 +1551,17 @@ const docTemplateClusterAPI = `{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"client.GetProcessResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"nodeid": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"process": {
|
||||||
|
"$ref": "#/definitions/github_com_datarhei_core_v16_cluster_store.Process"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"client.JoinRequest": {
|
"client.JoinRequest": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -2210,6 +2326,30 @@ const docTemplateClusterAPI = `{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"github_com_datarhei_core_v16_cluster_store.Process": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"config": {
|
||||||
|
"$ref": "#/definitions/app.Config"
|
||||||
|
},
|
||||||
|
"createdAt": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"error": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"metadata": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": true
|
||||||
|
},
|
||||||
|
"order": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"updatedAt": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"identity.Auth0Tenant": {
|
"identity.Auth0Tenant": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@@ -58,7 +58,7 @@
|
|||||||
"200": {
|
"200": {
|
||||||
"description": "OK",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/client.AboutResponse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"500": {
|
"500": {
|
||||||
@@ -796,7 +796,7 @@
|
|||||||
"200": {
|
"200": {
|
||||||
"description": "OK",
|
"description": "OK",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"$ref": "#/definitions/client.GetProcessResponse"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"404": {
|
"404": {
|
||||||
@@ -1423,6 +1423,111 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"client.AboutResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"address": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"resources": {
|
||||||
|
"$ref": "#/definitions/client.AboutResponseResources"
|
||||||
|
},
|
||||||
|
"started_at": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"version": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"client.AboutResponseGPUResources": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"decoder": {
|
||||||
|
"description": "Current decoder usage, 0-100",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"encoder": {
|
||||||
|
"description": "Current encoder usage, 0-100",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"memory_bytes": {
|
||||||
|
"description": "Currently used memory in bytes",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"memory_limit_bytes": {
|
||||||
|
"description": "Defined memory limit in bytes",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"memory_total_bytes": {
|
||||||
|
"description": "Total available memory in bytes",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"usage": {
|
||||||
|
"description": "Current general usage, 0-100",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"usage_limit": {
|
||||||
|
"description": "Defined general usage limit, 0-100",
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"client.AboutResponseResources": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"cpu": {
|
||||||
|
"description": "Current CPU load, 0-100*ncpu",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"cpu_core": {
|
||||||
|
"description": "Current CPU load of the core itself, 0-100*ncpu",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"cpu_limit": {
|
||||||
|
"description": "Defined CPU load limit, 0-100*ncpu",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"error": {
|
||||||
|
"description": "Last error",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"gpu": {
|
||||||
|
"description": "Currently used GPU resources",
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/client.AboutResponseGPUResources"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"is_throttling": {
|
||||||
|
"description": "Whether this core is currently throttling",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"memory_bytes": {
|
||||||
|
"description": "Currently used memory in bytes",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"memory_core_bytes": {
|
||||||
|
"description": "Current used memory of the core itself in bytes",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"memory_limit_bytes": {
|
||||||
|
"description": "Defined memory limit in bytes",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"memory_total_bytes": {
|
||||||
|
"description": "Total available memory in bytes",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"ncpu": {
|
||||||
|
"description": "Number of CPU on this node",
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"client.AddIdentityRequest": {
|
"client.AddIdentityRequest": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -1439,6 +1544,17 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"client.GetProcessResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"nodeid": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"process": {
|
||||||
|
"$ref": "#/definitions/github_com_datarhei_core_v16_cluster_store.Process"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"client.JoinRequest": {
|
"client.JoinRequest": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -2203,6 +2319,30 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"github_com_datarhei_core_v16_cluster_store.Process": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"config": {
|
||||||
|
"$ref": "#/definitions/app.Config"
|
||||||
|
},
|
||||||
|
"createdAt": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"error": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"metadata": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": true
|
||||||
|
},
|
||||||
|
"order": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"updatedAt": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"identity.Auth0Tenant": {
|
"identity.Auth0Tenant": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@@ -100,6 +100,81 @@ definitions:
|
|||||||
description: percent 0-100
|
description: percent 0-100
|
||||||
type: number
|
type: number
|
||||||
type: object
|
type: object
|
||||||
|
client.AboutResponse:
|
||||||
|
properties:
|
||||||
|
address:
|
||||||
|
type: string
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
resources:
|
||||||
|
$ref: '#/definitions/client.AboutResponseResources'
|
||||||
|
started_at:
|
||||||
|
type: string
|
||||||
|
version:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
client.AboutResponseGPUResources:
|
||||||
|
properties:
|
||||||
|
decoder:
|
||||||
|
description: Current decoder usage, 0-100
|
||||||
|
type: number
|
||||||
|
encoder:
|
||||||
|
description: Current encoder usage, 0-100
|
||||||
|
type: number
|
||||||
|
memory_bytes:
|
||||||
|
description: Currently used memory in bytes
|
||||||
|
type: integer
|
||||||
|
memory_limit_bytes:
|
||||||
|
description: Defined memory limit in bytes
|
||||||
|
type: integer
|
||||||
|
memory_total_bytes:
|
||||||
|
description: Total available memory in bytes
|
||||||
|
type: integer
|
||||||
|
usage:
|
||||||
|
description: Current general usage, 0-100
|
||||||
|
type: number
|
||||||
|
usage_limit:
|
||||||
|
description: Defined general usage limit, 0-100
|
||||||
|
type: number
|
||||||
|
type: object
|
||||||
|
client.AboutResponseResources:
|
||||||
|
properties:
|
||||||
|
cpu:
|
||||||
|
description: Current CPU load, 0-100*ncpu
|
||||||
|
type: number
|
||||||
|
cpu_core:
|
||||||
|
description: Current CPU load of the core itself, 0-100*ncpu
|
||||||
|
type: number
|
||||||
|
cpu_limit:
|
||||||
|
description: Defined CPU load limit, 0-100*ncpu
|
||||||
|
type: number
|
||||||
|
error:
|
||||||
|
description: Last error
|
||||||
|
type: string
|
||||||
|
gpu:
|
||||||
|
description: Currently used GPU resources
|
||||||
|
items:
|
||||||
|
$ref: '#/definitions/client.AboutResponseGPUResources'
|
||||||
|
type: array
|
||||||
|
is_throttling:
|
||||||
|
description: Whether this core is currently throttling
|
||||||
|
type: boolean
|
||||||
|
memory_bytes:
|
||||||
|
description: Currently used memory in bytes
|
||||||
|
type: integer
|
||||||
|
memory_core_bytes:
|
||||||
|
description: Current used memory of the core itself in bytes
|
||||||
|
type: integer
|
||||||
|
memory_limit_bytes:
|
||||||
|
description: Defined memory limit in bytes
|
||||||
|
type: integer
|
||||||
|
memory_total_bytes:
|
||||||
|
description: Total available memory in bytes
|
||||||
|
type: integer
|
||||||
|
ncpu:
|
||||||
|
description: Number of CPU on this node
|
||||||
|
type: number
|
||||||
|
type: object
|
||||||
client.AddIdentityRequest:
|
client.AddIdentityRequest:
|
||||||
properties:
|
properties:
|
||||||
identity:
|
identity:
|
||||||
@@ -110,6 +185,13 @@ definitions:
|
|||||||
config:
|
config:
|
||||||
$ref: '#/definitions/app.Config'
|
$ref: '#/definitions/app.Config'
|
||||||
type: object
|
type: object
|
||||||
|
client.GetProcessResponse:
|
||||||
|
properties:
|
||||||
|
nodeid:
|
||||||
|
type: string
|
||||||
|
process:
|
||||||
|
$ref: '#/definitions/github_com_datarhei_core_v16_cluster_store.Process'
|
||||||
|
type: object
|
||||||
client.JoinRequest:
|
client.JoinRequest:
|
||||||
properties:
|
properties:
|
||||||
id:
|
id:
|
||||||
@@ -620,6 +702,22 @@ definitions:
|
|||||||
format: int64
|
format: int64
|
||||||
type: integer
|
type: integer
|
||||||
type: object
|
type: object
|
||||||
|
github_com_datarhei_core_v16_cluster_store.Process:
|
||||||
|
properties:
|
||||||
|
config:
|
||||||
|
$ref: '#/definitions/app.Config'
|
||||||
|
createdAt:
|
||||||
|
type: string
|
||||||
|
error:
|
||||||
|
type: string
|
||||||
|
metadata:
|
||||||
|
additionalProperties: true
|
||||||
|
type: object
|
||||||
|
order:
|
||||||
|
type: string
|
||||||
|
updatedAt:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
identity.Auth0Tenant:
|
identity.Auth0Tenant:
|
||||||
properties:
|
properties:
|
||||||
audience:
|
audience:
|
||||||
@@ -944,7 +1042,7 @@ paths:
|
|||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
type: string
|
$ref: '#/definitions/client.AboutResponse'
|
||||||
"500":
|
"500":
|
||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
schema:
|
schema:
|
||||||
@@ -1471,7 +1569,7 @@ paths:
|
|||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
type: string
|
$ref: '#/definitions/client.GetProcessResponse'
|
||||||
"404":
|
"404":
|
||||||
description: Not Found
|
description: Not Found
|
||||||
schema:
|
schema:
|
||||||
|
40
docs/docs.go
40
docs/docs.go
@@ -5484,6 +5484,39 @@ const docTemplate = `{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"api.ClusterNodeGPUResources": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"memory_limit_bytes": {
|
||||||
|
"description": "Defined memory limit in bytes",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"memory_total_bytes": {
|
||||||
|
"description": "Total available memory in bytes",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"memory_used_bytes": {
|
||||||
|
"description": "Currently used memory in bytes",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"usage_decoder": {
|
||||||
|
"description": "Current decoder usage, 0-100",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"usage_encoder": {
|
||||||
|
"description": "Current encoder usage, 0-100",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"usage_general": {
|
||||||
|
"description": "Current general usage, 0-100",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"usage_limit": {
|
||||||
|
"description": "Defined general usage limit, 0-100",
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"api.ClusterNodeID": {
|
"api.ClusterNodeID": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -5510,6 +5543,13 @@ const docTemplate = `{
|
|||||||
"error": {
|
"error": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"gpu": {
|
||||||
|
"description": "GPU resources",
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/api.ClusterNodeGPUResources"
|
||||||
|
}
|
||||||
|
},
|
||||||
"is_throttling": {
|
"is_throttling": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
|
@@ -5477,6 +5477,39 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"api.ClusterNodeGPUResources": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"memory_limit_bytes": {
|
||||||
|
"description": "Defined memory limit in bytes",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"memory_total_bytes": {
|
||||||
|
"description": "Total available memory in bytes",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"memory_used_bytes": {
|
||||||
|
"description": "Currently used memory in bytes",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"usage_decoder": {
|
||||||
|
"description": "Current decoder usage, 0-100",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"usage_encoder": {
|
||||||
|
"description": "Current encoder usage, 0-100",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"usage_general": {
|
||||||
|
"description": "Current general usage, 0-100",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"usage_limit": {
|
||||||
|
"description": "Defined general usage limit, 0-100",
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"api.ClusterNodeID": {
|
"api.ClusterNodeID": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -5503,6 +5536,13 @@
|
|||||||
"error": {
|
"error": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"gpu": {
|
||||||
|
"description": "GPU resources",
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/api.ClusterNodeGPUResources"
|
||||||
|
}
|
||||||
|
},
|
||||||
"is_throttling": {
|
"is_throttling": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
|
@@ -283,6 +283,30 @@ definitions:
|
|||||||
description: unix timestamp
|
description: unix timestamp
|
||||||
type: integer
|
type: integer
|
||||||
type: object
|
type: object
|
||||||
|
api.ClusterNodeGPUResources:
|
||||||
|
properties:
|
||||||
|
memory_limit_bytes:
|
||||||
|
description: Defined memory limit in bytes
|
||||||
|
type: integer
|
||||||
|
memory_total_bytes:
|
||||||
|
description: Total available memory in bytes
|
||||||
|
type: integer
|
||||||
|
memory_used_bytes:
|
||||||
|
description: Currently used memory in bytes
|
||||||
|
type: integer
|
||||||
|
usage_decoder:
|
||||||
|
description: Current decoder usage, 0-100
|
||||||
|
type: number
|
||||||
|
usage_encoder:
|
||||||
|
description: Current encoder usage, 0-100
|
||||||
|
type: number
|
||||||
|
usage_general:
|
||||||
|
description: Current general usage, 0-100
|
||||||
|
type: number
|
||||||
|
usage_limit:
|
||||||
|
description: Defined general usage limit, 0-100
|
||||||
|
type: number
|
||||||
|
type: object
|
||||||
api.ClusterNodeID:
|
api.ClusterNodeID:
|
||||||
properties:
|
properties:
|
||||||
id:
|
id:
|
||||||
@@ -301,6 +325,11 @@ definitions:
|
|||||||
type: number
|
type: number
|
||||||
error:
|
error:
|
||||||
type: string
|
type: string
|
||||||
|
gpu:
|
||||||
|
description: GPU resources
|
||||||
|
items:
|
||||||
|
$ref: '#/definitions/api.ClusterNodeGPUResources'
|
||||||
|
type: array
|
||||||
is_throttling:
|
is_throttling:
|
||||||
type: boolean
|
type: boolean
|
||||||
memory_core_bytes:
|
memory_core_bytes:
|
||||||
|
@@ -39,16 +39,27 @@ type ClusterNodeCore struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ClusterNodeResources struct {
|
type ClusterNodeResources struct {
|
||||||
IsThrottling bool `json:"is_throttling"`
|
IsThrottling bool `json:"is_throttling"`
|
||||||
NCPU float64 `json:"ncpu"`
|
NCPU float64 `json:"ncpu"`
|
||||||
CPU float64 `json:"cpu_used"` // percent 0-100*npcu
|
CPU float64 `json:"cpu_used"` // percent 0-100*npcu
|
||||||
CPULimit float64 `json:"cpu_limit"` // percent 0-100*npcu
|
CPULimit float64 `json:"cpu_limit"` // percent 0-100*npcu
|
||||||
CPUCore float64 `json:"cpu_core"` // percent 0-100*ncpu
|
CPUCore float64 `json:"cpu_core"` // percent 0-100*ncpu
|
||||||
Mem uint64 `json:"memory_used_bytes"` // bytes
|
Mem uint64 `json:"memory_used_bytes"` // bytes
|
||||||
MemLimit uint64 `json:"memory_limit_bytes"` // bytes
|
MemLimit uint64 `json:"memory_limit_bytes"` // bytes
|
||||||
MemTotal uint64 `json:"memory_total_bytes"` // bytes
|
MemTotal uint64 `json:"memory_total_bytes"` // bytes
|
||||||
MemCore uint64 `json:"memory_core_bytes"` // bytes
|
MemCore uint64 `json:"memory_core_bytes"` // bytes
|
||||||
Error string `json:"error"`
|
GPU []ClusterNodeGPUResources `json:"gpu"` // GPU resources
|
||||||
|
Error string `json:"error"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ClusterNodeGPUResources struct {
|
||||||
|
Mem uint64 `json:"memory_used_bytes"` // Currently used memory in bytes
|
||||||
|
MemLimit uint64 `json:"memory_limit_bytes"` // Defined memory limit in bytes
|
||||||
|
MemTotal uint64 `json:"memory_total_bytes"` // Total available memory in bytes
|
||||||
|
Usage float64 `json:"usage_general"` // Current general usage, 0-100
|
||||||
|
UsageLimit float64 `json:"usage_limit"` // Defined general usage limit, 0-100
|
||||||
|
Encoder float64 `json:"usage_encoder"` // Current encoder usage, 0-100
|
||||||
|
Decoder float64 `json:"usage_decoder"` // Current decoder usage, 0-100
|
||||||
}
|
}
|
||||||
|
|
||||||
type ClusterRaft struct {
|
type ClusterRaft struct {
|
||||||
|
@@ -123,9 +123,22 @@ func (h *ClusterHandler) marshalClusterNode(node cluster.ClusterNode) api.Cluste
|
|||||||
MemLimit: node.Resources.MemLimit,
|
MemLimit: node.Resources.MemLimit,
|
||||||
MemTotal: node.Resources.MemTotal,
|
MemTotal: node.Resources.MemTotal,
|
||||||
MemCore: node.Resources.MemCore,
|
MemCore: node.Resources.MemCore,
|
||||||
|
GPU: []api.ClusterNodeGPUResources{},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for _, gpu := range node.Resources.GPU {
|
||||||
|
n.Resources.GPU = append(n.Resources.GPU, api.ClusterNodeGPUResources{
|
||||||
|
Mem: gpu.Mem,
|
||||||
|
MemLimit: gpu.MemLimit,
|
||||||
|
MemTotal: gpu.MemTotal,
|
||||||
|
Usage: gpu.Usage,
|
||||||
|
UsageLimit: gpu.UsageLimit,
|
||||||
|
Encoder: gpu.Encoder,
|
||||||
|
Decoder: gpu.Decoder,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
if node.Error != nil {
|
if node.Error != nil {
|
||||||
n.Error = node.Error.Error()
|
n.Error = node.Error.Error()
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user