Skip to content

Latest commit

 

History

History
143 lines (122 loc) · 5.27 KB

README.md

File metadata and controls

143 lines (122 loc) · 5.27 KB

cpu - CPU usage

Provides CPU usage information as micro-service; updates periodically (default 60 seconds or 1 minute). This container may be run locally using Docker, pushed to a Docker registry, and published to any Open Horizon exchange.

Status

Supports amd64 Architecture

Supports arm Architecture Docker Pulls

Supports arm64 Architecture Docker Pulls

Service discovery

Service variables

  • CPU_PERIOD - seconds between updates; defaults to 60
  • CPU_INTERVAL - seconds between CPU tests; defaults to 1
  • LOG_LEVEL - specify level of logging; default info; options include (debug and none)

How To Use

Copy this repository, change to the cpu directory, then use the make command; see below:

% mkdir ~/gitdir
% cd ~/gitdir
% git clone https://github.com/dcmartin/open-horizon
% cd open-horizon/cpu
% make
...
{
  "cpu": {
    "date": 1554314683
  },
  "date": 1554314683,
  "hzn": {
    "agreementid": "",
    "arch": "",
    "cpus": 0,
    "device_id": "",
    "exchange_url": "",
    "host_ips": [
      ""
    ],
    "organization": "",
    "ram": 0,
    "pattern": null
  },
  "config": {
    "log_level": "info",
    "debug": false,
    "period": "60",
    "interval": "1",
    "services": null
  },
  "service": {
    "label": "cpu",
    "version": "0.0.3"
  }
}

The cpu payload will be incomplete until the service initiates; subsequent make check will return complete; see below:

{
  "cpu": {
    "date": 1554314684,
    "percent": 5.27
  },
  "date": 1554314683,
  "hzn": {
    "agreementid": "",
    "arch": "",
    "cpus": 0,
    "device_id": "",
    "exchange_url": "",
    "host_ips": [
      ""
    ],
    "organization": "",
    "ram": 0,
    "pattern": null
  },
  "config": {
    "log_level": "info",
    "debug": false,
    "period": "60",
    "interval": "1",
    "services": null
  },
  "service": {
    "label": "cpu",
    "version": "0.0.3"
  }
}

Changelog & Releases

Releases are based on Semantic Versioning, and use the format of MAJOR.MINOR.PATCH. In a nutshell, the version will be incremented based on the following:

  • MAJOR: Incompatible or major changes.
  • MINOR: Backwards-compatible new features and enhancements.
  • PATCH: Backwards-compatible bugfixes and package updates.

Authors & contributors

David C Martin ([email protected])