<commit_before><commit_msg>[utils] Commit the script used to submit perf data.<commit_after>#!/bin/sh

set -ex

# Compute the "run order" as the number of commits on the branch.
echo "**** Computing Revision Index ****"
num_commits=$(echo $(cd "${XCS_SOURCE_DIR}"/llbuild && git log --format=oneline | wc -l))
echo "llbuild commits: ${num_commits}"

# Extract the performance data into the LNT format.
echo "**** Converting Performance Data ****"
data_path="${TMPDIR}/performance-data.json"
"${XCS_SOURCE_DIR}/llbuild/utils/Xcode/extract-perf-data" \
  --run-order "${num_commits}" \
  --machine-name dtprojectcore \
  --output-path "${data_path}" \
  "${XCS_DERIVED_DATA_DIR}/Logs/Test/"*.xcactivitylog

# Submit the results to the local server.
echo "**** Uploading Performance Data ****"
/Library/Server/Web/Data/WebApps/perf/venv/bin/lnt submit \
  http://localhost/perf/db_llbuild/submitRun "${data_path}"

{'fraction_non_alphanumeric': 0.1668496158068057, 'fraction_numerical': 0.0, 'mean_word_length': 4.772151898734177, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5919261', 'n_tokens_mistral': 311, 'n_tokens_neox': 300, 'n_words': 75}