#!/bin/bash

BASE_DIR="$(cd "$(dirname "$0")"; pwd)";

JAVA_HOME=
AGENT_PROCESS_NAME=wasup-agent
LOG_FILE=$BASE_DIR/../logs/agent.log
export MANAGER_URL=localhost:8080/wasup

JAVA_OPTS="-Djava.net.preferIPv4Stack=true"
JAVA_OPTS="$JAVA_OPTS -Xms256m -Xmx512m -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=256m"
JAVA_OPTS="$JAVA_OPTS -XX:+UseG1GC"
JAVA_OPTS="$JAVA_OPTS -XX:+UseLargePagesInMetaspace"
JAVA_OPTS="$JAVA_OPTS -XX:+ExplicitGCInvokesConcurrent"
JAVA_OPTS="$JAVA_OPTS -XX:+DisableExplicitGC"
JAVA_OPTS="$JAVA_OPTS -XX:ReservedCodeCacheSize=512m"
JAVA_OPTS="$JAVA_OPTS -XX:-UseCodeCacheFlushing"
JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF-8"
JAVA_OPTS="$JAVA_OPTS -Dfile.client.encoding=UTF-8"
JAVA_OPTS="$JAVA_OPTS -Djava.security.egd=file:/dev/urandom"
JAVA_OPTS="$JAVA_OPTS -Djava.library.path=$BASE_DIR/../sigar"
JAVA_OPTS="$JAVA_OPTS -DLOG_FILE=$LOG_FILE"
JAVA_OPTS="$JAVA_OPTS -Dwasup.websocket.endpoint=ws://$MANAGER_URL/websocket"