aws-memory-metrics

command module
v0.0.0-...-7b5cf77 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2024 License: MIT Imports: 17 Imported by: 0

README

aws-memory-metrics

Report memory-metrics to AWS CloudWatch

Install dependencies

$ go get

Build the binary

$ time { go fmt ./main.go && go build -o aws-memory-metrics ./main.go ; }

real	0m0.143s
user	0m0.306s
sys	0m0.142s

Usage

$ ./aws-memory-metrics --help
Usage of ./aws-memory-metrics:
  -p value
    	comma-separated list, to append extra Nextjs=<pid> (shorthand)
  -pids value
    	comma-separated list, to append extra NodeServer=<pid>,Nextjs=<pid>

# can run with zero or more extra pids to report memory usage; deploy time to run with pgrep to get pid of a target application

$ ./aws-memory-metrics -pids Nextjs=$(pgrep --full bin/next --oldest)

deploy the binary to any AWS hosts

with scp or rsync, copy the binary aws-memory-metrics to any AWS hosts and install into crontab

command: "crontab -l | grep -q 'aws-memory-metrics' || crontab -l | { cat; echo '* * * * * /path/to/aws-memory-metrics -pids Nextjs=$(pgrep --full bin/next --oldest) &>/dev/null'; } | crontab -"

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL