Skip to content

gregtuc/docker-data-metrics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker data metrics

small program to collect data on a docker container and make it available on a webserver

Try it out:


Spin up a docker container using the below command(s) in cmd/terminal:

docker pull progrium/stress

docker run --name testcontainer --rm -it progrium/stress --cpu 1 --io 1 --vm 2 --vm-bytes 128M

Alternatively, start your own Docker container + name and change the name value in the .env file.

Execution:


Clone the repository then execute go get . and then go run . from within the project directory.

Testing:


Get all Logs

GET to http://localhost:8080/metrics/

Get all logs under a certain CPU %

GET to http://localhost:8080/metrics/cpu?under=<cpu_percent>

Get all logs over a certain CPU %

GET to http://localhost:8080/metrics/cpu?over=<cpu_percent>

Get all logs within a certain CPU % range

GET to http://localhost:8080/metrics/cpu?over=<cpu_percent>&under=<cpu_percent>

Get all logs before a certain time

GET to http://localhost:8080/metrics/?before=<unix_timestamp>

Get all logs after a certain time

GET to http://localhost:8080/metrics/?after=<unix_timestamp>

Get all logs within a certain time range

GET to http://localhost:8080/metrics/?before=<unix_timestamp>&after=<unix_timestamp>

Get most recent log (live)

GET to http://localhost:8080/metrics/live

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages