Sha256: c3f95f5b6743b6561cc735c201cfe35b270ff83ad65e27fc4698c6a4b5447a35

Contents?: true

Size: 500 Bytes

Versions: 2

Compression:

Stored size: 500 Bytes

Contents

#!/bin/bash

DELAY=0.1

while true
do
	start_timestamp=`date +%s.%N`

	paths=`find /sys/fs/cgroup/memory/docker/* -type d`
	for path in $paths
	do
		id=${path##*/}
		memory=`cat /sys/fs/cgroup/memory/docker/${id}/memory.usage_in_bytes`
		echo -ne "${id}\t${memory} "
	done
	if [[ "$paths" != "" ]]
	then
		echo
	fi

	end_timestamp=`date +%s.%N`
	to_wait=`perl -e "print ${DELAY} - ${end_timestamp} + ${start_timestamp}"`

	if [[ `echo ${to_wait}'>'0 | bc -l` -ne 0 ]]
	then
		sleep $to_wait
	fi
done

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fluent-plugin-detect-exceptions-0.0.5 measure_memory.sh
fluent-plugin-detect-exceptions-0.0.4 measure_memory.sh