<commit_before>window.App = {};
App.refreshTime = 2000;
App.oldStats = {};
App.newStats = {};

App.getStats = function(){
	$.getJSON("/stats", function(data){
		App.oldStats = App.newStats;
		App.newStats = data;
	})
}

App.updateHitRatio = function(){
	$("#hit-ratio").text(App.newStats.cache_hit.value);
}

App.updateData = function(){
	App.getStats();
	App.updateHitRatio();
}

$(function(){

	setInterval(App.updateData,App.refreshTime);
	
});<commit_msg>first commit<commit_after>window.App = {};
App.refreshTime = 2000;
App.oldStats = {};
App.newStats = {};

App.getStats = function(){
	$.getJSON("/stats", function(data){
		App.oldStats = App.newStats;
		App.newStats = data;
	})
}

App.calcHitRatio = function(){
	hitRatio = (App.newStats.cache_hit.value*100)/App.newStats.client_req.value;
	return hitRatio;
}

App.updateHitRatio = function(){
	$("#hit-ratio").html("<h1>"+App.calcHitRatio()+"</h1>");
}

App.updateData = function(){
	App.getStats();
	App.updateHitRatio();
}

$(function(){

	setInterval(App.updateData,App.refreshTime);
	
});
{'fraction_non_alphanumeric': 0.20722433460076045, 'fraction_numerical': 0.012357414448669201, 'mean_word_length': 5.086705202312139, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '587217', 'n_tokens_mistral': 399, 'n_tokens_neox': 382, 'n_words': 51}