mirror of
https://github.com/pstadler/metrics.sh.git
synced 2025-02-28 22:09:11 -05:00
24 lines
404 B
Bash
24 lines
404 B
Bash
|
#!/bin/sh
|
||
|
|
||
|
report () {
|
||
|
local METRIC=$1
|
||
|
local VALUE=$2
|
||
|
local DATE=$(iso_date)
|
||
|
echo $DATE $METRIC: $VALUE >> $FILE_LOCATION
|
||
|
}
|
||
|
|
||
|
init () {
|
||
|
if [ -z $FILE_LOCATION ]; then
|
||
|
echo "Missing configuration: \$FILE_LOCATION"
|
||
|
return 1
|
||
|
fi
|
||
|
|
||
|
if [ ! -f $FILE_LOCATION ]; then
|
||
|
touch $FILE_LOCATION
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
docs () {
|
||
|
echo "Write to a file or named pipe."
|
||
|
echo "\$FILE_LOCATION=$FILE_LOCATION"
|
||
|
}
|