Skip to content

qeqar/system-stats-consul-template-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

system-stats-consul-template-plugin

Get system stats to use in Consul Template

Plugin based on gopsutil use system stats in Consul Template. f.e. calculate HEAP for Java APPs.

Syntax

{{ plugin system-stats-consul-template-plugin "<statsType>"" }}

Stats

  • memory
  • cpuInfo
  • cpuCount

Expample

###get total mempory

{{ with $d := plugin "system-stats-consul-template-plugin" "memory" |parseJSON }}{{ $d.total }}{{ end }}

Calculate HEAP Space in MB

{{ with $d := plugin "system-stats-consul-template-plugin" "memory" |parseJSON }}{{ printf "%.f" (($d.total | multiply 0.8) | divide 1000 | divide 1000) }}{{ end }}

Links

About

Get Systemstats to use in Consule Template

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages