<commit_before>import { getStatsDClient } from './statsd';

const defaultSampleInterval = 60;

export function startSampling(metricName, sampleInterval = defaultSampleInterval) {
	var statsd = getStatsDClient();

	function updateMetric(diff) {
		const elapsed = diff[0] * 1000000 + diff[1] / 1000 - sampleInterval;
		statsd.timing(metricName, elapsed);
	}

	function loop() {
		let time = process.hrtime();<commit_msg>Fix loop delay measurement scaling<commit_after>import { getStatsDClient } from './statsd';

const defaultSampleInterval = 60;

export function startSampling(metricName, sampleInterval = defaultSampleInterval) {
	var statsd = getStatsDClient();

	function updateMetric(diff) {
		const elapsed = diff[0] * 1000 + diff[1] / 1000000 - sampleInterval;
		statsd.timing(metricName, elapsed);
	}

	function loop() {
		let time = process.hrtime();
{'fraction_non_alphanumeric': 0.11201866977829639, 'fraction_numerical': 0.03500583430571762, 'mean_word_length': 5.355555555555555, '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': '7025555', 'n_tokens_mistral': 289, 'n_tokens_neox': 250, 'n_words': 65}