Skip to content

Instantly share code, notes, and snippets.

@dunithd
Created August 21, 2021 02:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dunithd/155166133b316d7f2da4f24642ab5264 to your computer and use it in GitHub Desktop.
Save dunithd/155166133b316d7f2da4f24642ab5264 to your computer and use it in GitHub Desktop.
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