<commit_before>#!/bin/bash

set -x -e # Output commands being executed and propogate errors.
cd $(dirname $0)/.. # cd into the snowglobe directory

./scripts/bootstrap.sh
#./scripts/start-collect-enrich.sh &
stdbuf -i0 -o0 -e0 \
  ./vendor/snowplow-stream-collector-0.4.0 --config ./conf/collector.conf \
  | ./vendor/snowplow-kinesis-enrich-0.5.0 \
    --config ./conf/enrich.conf \
    --resolver file:./conf/resolver.json \
    --enrichments file:./conf/enrichments &
CE_PID=$!

sleep 10 # Be sure the collector and enricher are initialized.
./sample/send-view.rb # Send a single page view.

SG=./dist/build/snowglobe-analysis/snowglobe-analysis
for MODE in {DaySummary,DayReport,WeekReport}; do
  $SG --events data/events.tsv $MODE
done

kill $CE_PID
<commit_msg>Correct path to the GeoDB<commit_after>#!/bin/bash

set -x -e # Output commands being executed and propogate errors.
cd $(dirname $0)/.. # cd into the snowglobe directory

./scripts/bootstrap.sh

sed "s|home/bamos/repos/snowglobe|$PWD|g" \
    conf/enrichments/ip_lookups.json \
    > conf/enrichments/ip_lookups.new.json
mv conf/enrichments/ip_lookups{.new,}.json

#./scripts/start-collect-enrich.sh &
stdbuf -i0 -o0 -e0 \
  ./vendor/snowplow-stream-collector-0.4.0 --config ./conf/collector.conf \
  | ./vendor/snowplow-kinesis-enrich-0.5.0 \
    --config ./conf/enrich.conf \
    --resolver file:./conf/resolver.json \
    --enrichments file:./conf/enrichments &
CE_PID=$!

sleep 10 # Be sure the collector and enricher are initialized.
./sample/send-view.rb # Send a single page view.

SG=./dist/build/snowglobe-analysis/snowglobe-analysis
for MODE in {DaySummary,DayReport,WeekReport}; do
  $SG --events data/events.tsv $MODE
done

kill $CE_PID

{'fraction_non_alphanumeric': 0.14793244030285382, 'fraction_numerical': 0.013977868375072802, 'mean_word_length': 3.231527093596059, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '2681695', 'n_tokens_mistral': 655, 'n_tokens_neox': 637, 'n_words': 140}