This is a simple ZIO based application that collects concurrent online viewership metrics from Slovenian national broadcaster and its RTV 356 online services.
export LOGLOG_ENV="development"
export INFLUXDB_URL="http://0.0.0.0:8086"
export INFLUXDB_TOKEN="<required>"
export INFLUXDB_ORG="<required>"
export INFLUXDB_BUCKET="<required>"
export PATCH_API_URL=http://localhost:7070
./bin/loglog-dev.sh up -d --remove-orphans
sbt ~reStart # On host
sbt "~compile;docker:publishLocal;reStartContainer" # Via Docker
Release a new version with the following SBT command.
sbt "release release-version 0.0.1 next-version 0.0.2"
Deploy to production with sbt
and ansible
playbook with
sbt "docker:publish;deploy"
To demonstrate the service resiliency to networking exceptions; the following example can be used to inject networking " delay" into "gateway" nginx proxy container. This will cause the service to fail and yet proceed to operate.
./bin/loglog-dev.sh exec gateway tc qdisc add dev eth0 root netem delay 10s
To remote the delay from the container via tc
you can use the following set of commands
./bin/loglog-dev.sh exec gateway tc qdisc del root dev eth0