<commit_before>#!/usr/bin/awk -f

BEGIN {
	min = 10000000
}

{
	val = $2

	if (val < min)
		min = val
	if (val > max)
		max = val
	avg += val
}

END {
	avg /= NR
	inv = 1000000
	print "Min/avg/max frametimes (us): 	" min " / " avg " / " max
	print "Min/avg/max FPS:		" inv/max " / " inv/avg " / " inv/min
}<commit_msg>Add percentiles support to stats.awk<commit_after>#!/usr/bin/awk -f

BEGIN {
	min = 10000000
}

{
	val = $2

	if (val < min)
		min = val
	if (val > max)
		max = val
	avg += val

	# percentiles
	array[NR] = val
}

END {
	avg /= NR
	inv = 1000000

	asort(array)

	p50 = int(NR / 2)
	p90 = int(NR * 0.9)
	p95 = int(NR * 0.95)
	p99 = int(NR * 0.99)

	print "Min/avg/max frametimes (us): 	" min " / " avg " / " max
	print "Min/avg/max FPS:		" inv/max " / " inv/avg " / " inv/min
	print ""
	print "50/90/95/99 percentiles (us):	" array[p50] " / " array[p90] " / " \
			array[p95] " / " array[p99]
}
{'fraction_non_alphanumeric': 0.18681318681318682, 'fraction_numerical': 0.07142857142857142, 'mean_word_length': 2.2535714285714286, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '1001412', 'n_tokens_mistral': 488, 'n_tokens_neox': 420, 'n_words': 103}