Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
asyncapi: '2.0.0'
info:
title: Metrics Service
version: 1.0.0
description: This service is in charge of providing health data for a computer cluster
servers:
production:
url: 'ws://localhost:8080'
protocol: ws
channels:
metrics/{machineId}/memory:
parameters:
machineId:
$ref: '#/components/parameters/machineId'
subscribe:
message:
$ref: '#/components/messages/MemoryInfo'
metrics/{machineId}/cpu:
parameters:
machineId:
$ref: '#/components/parameters/machineId'
subscribe:
message:
$ref: '#/components/messages/CPUInfo'
components:
messages:
MemoryInfo:
payload:
type: object
properties:
timestamp:
type: integer
format: int64
description: Timestamp when the measurement was taken
heap:
type: string
description: Amount of heap memory
nonHeap:
type: string
description: Amount of non-heap memory
CPUInfo:
payload:
type: object
properties:
timestamp:
type: integer
format: int64
description: Timestamp when the measurement was taken
utilized:
type: string
description: Current CPU utilization
parameters:
machineId:
description: Id of the machine.
schema:
type: string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment