File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 1
1
FROM alpine:3.8
2
+ RUN apk add --no-cache bc
2
3
COPY ./entrypoint.sh /
3
4
ENTRYPOINT ["/entrypoint.sh" ]
5
+ CMD [ "100" , "5000" ]
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
while [ 1 ]
3
3
do
4
- waitTime=$( shuf -i 1-5 -n 1)
5
- sleep $waitTime &
6
- wait $!
7
- instruction=$( shuf -i 0-4 -n 1)
8
- d=` date -Iseconds`
9
- case " $instruction " in
10
- " 1" ) echo " $d ERROR something happened in this execution."
4
+ WAIT=$( shuf -i $1 -$2 -n 1)
5
+ sleep $( echo " scale=4; $WAIT /1000" | bc)
6
+ I=$( shuf -i 1-4 -n 1)
7
+ D=` date -Iseconds`
8
+ case " $I " in
9
+ " 1" ) echo " $D ERROR An error is usually an exception that has been caught and not handled."
11
10
;;
12
- " 2" ) echo " $d INFO takes the value and converts it to string ."
11
+ " 2" ) echo " $D INFO This is less important than debug log and is often used to provide context in the current task ."
13
12
;;
14
- " 3" ) echo " $d WARN variable not in use ."
13
+ " 3" ) echo " $D WARN A warning that should be ignored is usually at this level and should be actionable ."
15
14
;;
16
- " 4" ) echo " $d DEBUG first loop completed ."
15
+ " 4" ) echo " $D DEBUG This is a debug log that shows a log that can be ignored ."
17
16
;;
18
17
esac
19
18
done
You can’t perform that action at this time.
0 commit comments