<commit_before>#!/bin/bash
#
# Copyright 2014 by Cloudsoft Corporation Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#set -x # debug

ROOT=$(cd "$(dirname "$0")/.." && pwd -P)

# set blueprint and catalog options
if [ $# -eq 1 ] ; then
    CLOCKER="--app ${ROOT}/blueprints/docker-cloud.yaml --location $1"
fi
export JAVA_OPTS="-Xms1g -Xmx1g ${CLOCKER_OPTS} -Dbrooklyn.catalog.url=classpath://catalog.xml -Dbrooklyn.catalog.mode=LOAD_BROOKLYN_CATALOG_URL"

# launch clocker
${ROOT}/bin/brooklyn.sh launch ${CLOCKER} 2>&1 | tee -a console .log<commit_msg>Enable persistence in clocker.sh script<commit_after>#!/bin/bash
#
# Copyright 2014 by Cloudsoft Corporation Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#set -x # debug

# get base directory
ROOT=$(cd "$(dirname "$0")/.." && pwd -P)

# check command line arguments for location
if [ $# -eq 1 ] ; then
    LAUNCH_FLAGS="--app ${ROOT}/blueprints/docker-cloud.yaml --location $1"
elif [ $# -ne 0 ] ; then
    echo "Too many arguments; Usage: clocker.sh [location]"
    exit 1
fi

# set catalog and java options
CATALOG_OPTS="-Dbrooklyn.catalog.url=classpath://catalog.xml -Dbrooklyn.catalog.mode=LOAD_BROOKLYN_CATALOG_URL"
JAVA_OPTS="${JAVA_OPTS:--Xms1g -Xmx1g} ${CLOCKER_OPTS} ${CATALOG_OPTS}"
export JAVA_OPTS

# launch clocker
${ROOT}/bin/brooklyn.sh launch ${LAUNCH_FLAGS} \
    --ignoreManagedAppsStartupErrors \
    --ignorePersistenceStartupErrors \
    --persist auto \
    --persistenceDir ${HOME}/.clocker \
    --stopOnShutdown none 2>&1 | tee -a ${ROOT}/console.log
{'fraction_non_alphanumeric': 0.11692913385826771, 'fraction_numerical': 0.012598425196850394, 'mean_word_length': 4.164634146341464, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5316117', 'n_tokens_mistral': 825, 'n_tokens_neox': 773, 'n_words': 280}