<commit_before>(defn empty-edge-aggregation
  [params]
  {"type" "aggregate-edge"
   "runtime" 0
   "runs-total" 0
   "runs-succeeded" 0
   "runs-failed" 0
   "status-codes" {}
   "time-slices" {}
   "all-runtimes" []})

(defn empty-relay-aggregation
  [params]
  {"type" "aggregate-relay"
   "runtime" 0
   "runs-total" 0
   "runs-succeeded" 0
   "runs-failed" 0
   "status-codes" {}
   "time-slices" {}
   "percentiles" (PercentileRecorder. (or (params "timeout") 10000))})

(defn successes
  [results]
  (filter #(not= "thrown" (get %1 :status))
          results))

(defn edge-agg-totals
  [{:strs [runs-total runs-failed runs-succeeded] :as stats} results]
  (let [total (+ runs-total (count results))
        succeeded (+ runs-succeeded (count (successes results)))
        failed (- total succeeded)]
    (assoc stats
      "runs-total" total
      "runs-failed" failed
      "runs-succeeded" succeeded)))

(defn edge-agg-times
  [{runtime "runtime" :as stats} results]
  (assoc stats
    "all-runtimes" (map :runtime results)
    "runtime" (reduce
               (fn [m r] (+ m (:runtime r)))
               runtime
               results)))

(defn edge-agg-statuses
  [{scounts "status-codes" :as stats} results]
  (assoc stats "status-codes"<commit_msg>Up default percentile recorder range to 90k<commit_after>(defn empty-edge-aggregation
  [params]
  {"type" "aggregate-edge"
   "runtime" 0
   "runs-total" 0
   "runs-succeeded" 0
   "runs-failed" 0
   "status-codes" {}
   "time-slices" {}
   "all-runtimes" []})

(defn empty-relay-aggregation
  [params]
  {"type" "aggregate-relay"
   "runtime" 0
   "runs-total" 0
   "runs-succeeded" 0
   "runs-failed" 0
   "status-codes" {}
   "time-slices" {}
   "percentiles" (PercentileRecorder. (or (params "timeout") 90000))})

(defn successes
  [results]
  (filter #(not= "thrown" (get %1 :status))
          results))

(defn edge-agg-totals
  [{:strs [runs-total runs-failed runs-succeeded] :as stats} results]
  (let [total (+ runs-total (count results))
        succeeded (+ runs-succeeded (count (successes results)))
        failed (- total succeeded)]
    (assoc stats
      "runs-total" total
      "runs-failed" failed
      "runs-succeeded" succeeded)))

(defn edge-agg-times
  [{runtime "runtime" :as stats} results]
  (assoc stats
    "all-runtimes" (map :runtime results)
    "runtime" (reduce
               (fn [m r] (+ m (:runtime r)))
               runtime
               results)))

(defn edge-agg-statuses
  [{scounts "status-codes" :as stats} results]
  (assoc stats "status-codes"
{'fraction_non_alphanumeric': 0.15492957746478872, 'fraction_numerical': 0.011737089201877934, 'mean_word_length': 2.880121396054628, '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': '5825809', 'n_tokens_mistral': 966, 'n_tokens_neox': 910, 'n_words': 225}