<commit_before>#!/bin/bash

# Pull data from MySQL server and graph them.

LOCAL=$(date)
LOCALSECONDS=$(date -d "$LOCAL" +%s)
UTC=$(date -u -d "$LOCAL" +"%Y-%m-%d %H:%M:%S")  #remove timezone reference
UTCSECONDS=$(date -d "$UTC" +%s)
UTCOFFSET=$((LOCALSECONDS - UTCSECONDS))

pushd "$HOME/upsdiagd" >/dev/null || exit 1
  if [ $(wc -l < /tmp/upsdiagd/mysql/upsd.csv) -gt 5 ]; then
    # ups13 and ups14 are disabled, because the current UPS (EATON) does not supply
    # usable data for these graphs
    #echo -n "UPS13"
    #time gnuplot -e "utc_offset='${UTCOFFSET}'" ./graphs/ups13.gp
    #echo -n "UPS14"
    #time gnuplot -e "utc_offset='${UTCOFFSET}'" ./graphs/ups14.gp
    echo -n "UPS15"
    time gnuplot -e "utc_offset='${UTCOFFSET}'" ./graphs/ups15.gp
    echo -n "UPS16"
    time gnuplot -e "utc_offset='${UTCOFFSET}'" ./graphs/ups16.gp
    echo -n "UPS17"
    time gnuplot -e "utc_offset='${UTCOFFSET}'" ./graphs/ups17.gp
  fi
popd >/dev/null<commit_msg>timeout gnuplot because it tends to hang<commit_after>#!/bin/bash

# Pull data from MySQL server and graph them.

LOCAL=$(date)
LOCALSECONDS=$(date -d "$LOCAL" +%s)
UTC=$(date -u -d "$LOCAL" +"%Y-%m-%d %H:%M:%S")  #remove timezone reference
UTCSECONDS=$(date -d "$UTC" +%s)
UTCOFFSET=$((LOCALSECONDS - UTCSECONDS))

pushd "$HOME/upsdiagd" >/dev/null || exit 1
  if [ $(wc -l < /tmp/upsdiagd/mysql/upsd.csv) -gt 5 ]; then
    # ups13 and ups14 are disabled, because the current UPS (EATON) does not supply
    # usable data for these graphs
    #echo -n "UPS13"
    #time gnuplot -e "utc_offset='${UTCOFFSET}'" ./graphs/ups13.gp
    #echo -n "UPS14"
    #time gnuplot -e "utc_offset='${UTCOFFSET}'" ./graphs/ups14.gp
    echo -n "UPS15"
    time timeout 120s gnuplot -e "utc_offset='${UTCOFFSET}'" ./graphs/ups15.gp
    echo -n "UPS16"
    time timeout 120s gnuplot -e "utc_offset='${UTCOFFSET}'" ./graphs/ups16.gp
    echo -n "UPS17"
    time timeout 120s gnuplot -e "utc_offset='${UTCOFFSET}'" ./graphs/ups17.gp
  fi
popd >/dev/null
{'fraction_non_alphanumeric': 0.178, 'fraction_numerical': 0.0305, 'mean_word_length': 3.476510067114094, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '1939817', 'n_tokens_mistral': 867, 'n_tokens_neox': 807, 'n_words': 215}