<commit_before>#!/bin/bash

if [ "$GRAPHITE_ROOT" = "" ]
then
  GRAPHITE_ROOT="/opt/graphite"
fi

WHISPER_DIR="${GRAPHITE_ROOT}/storage/whisper"

if [ ! -d "$WHISPER_DIR" ]
then
  echo "Fatal Error: $WHISPER_DIR does not exist."
  exit 1
fi

INDEX_FILE="${GRAPHITE_ROOT}/storage/index"
TMP_INDEX="${GRAPHITE_ROOT}/storage/.index.tmp"

rm -f $TMP_INDEX
cd $WHISPER_DIR
echo "[`date`]  building index..."
find . -name '*.wsp' | perl -pe 's!^[^/]+/(.+)\.wsp$!$1!; s!/!.!g' > $TMP_INDEX
echo "[`date`]  complete, switching to new index file"
mv -f $TMP_INDEX $INDEX_FILE<commit_msg>symlinks are good mkay<commit_after>#!/bin/bash

if [ "$GRAPHITE_ROOT" = "" ]
then
  GRAPHITE_ROOT="/opt/graphite"
fi

WHISPER_DIR="${GRAPHITE_ROOT}/storage/whisper"

if [ ! -d "$WHISPER_DIR" ]
then
  echo "Fatal Error: $WHISPER_DIR does not exist."
  exit 1
fi

INDEX_FILE="${GRAPHITE_ROOT}/storage/index"
TMP_INDEX="${GRAPHITE_ROOT}/storage/.index.tmp"

rm -f $TMP_INDEX
cd $WHISPER_DIR
echo "[`date`]  building index..."
find -L . -name '*.wsp' | perl -pe 's!^[^/]+/(.+)\.wsp$!$1!; s!/!.!g' > $TMP_INDEX
echo "[`date`]  complete, switching to new index file"
mv -f $TMP_INDEX $INDEX_FILE
{'fraction_non_alphanumeric': 0.199486301369863, 'fraction_numerical': 0.003424657534246575, 'mean_word_length': 4.462616822429907, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4580943', 'n_tokens_mistral': 510, 'n_tokens_neox': 491, 'n_words': 107}