<commit_before>package net.java.dev.moskito.webui.decorators.predefined;

import java.util.ArrayList;
import java.util.List;

import net.java.dev.moskito.core.producers.IStats;
import net.java.dev.moskito.core.stats.TimeUnit;
import net.java.dev.moskito.web.session.SessionCountStats;
import net.java.dev.moskito.webui.bean.LongValueBean;
import net.java.dev.moskito.webui.bean.StatValueBean;
import net.java.dev.moskito.webui.decorators.AbstractDecorator;

public class SessionCountDecorator extends AbstractDecorator{
	private static String CAPTIONS[] = {
		"Cur",
		"Min",
		"Max",
		"New",
		"Del",
	};
	
	private static String SHORT_EXPLANATIONS[] = {
		"Current number of sessions",
		"Min number of sessions",
		"Max number of sessions",
		"Number of created sessions",
		"Number of deleted sessions",
	};


	private static String EXPLANATIONS[] = {
		"Current number of sessions",
		"Min number of sessions",
		"Max number of sessions",
		"Number of created sessions",
		"Number of deleted sessions",
	};

	
	public SessionCountDecorator(){
		super("HttpSession", CAPTIONS, SHORT_EXPLANATIONS, EXPLANATIONS);
	}
	

	@Override public List<StatValueBean> getValues(IStats statsObject, String interval, TimeUnit unit) {
		SessionCountStats stats = (SessionCountStats)statsObject;
		List<StatValueBean> ret = new ArrayList<StatValueBean>(CAPTIONS.length);
		
		int i = 0;
		
		ret.add(new LongValueBean(CAPTIONS[i++], stats.getCurrentSessionCount(interval)));
		ret.add(new LongValueBean(CAPTIONS[i++], stats.getMinSessionCount(interval)));
		ret.add(new LongValueBean(CAPTIONS[i++], stats.getMaxSessionCount(interval)));
		ret.add(new LongValueBean(CAPTIONS[i++], stats.getCreatedSessionCount(interval)));
		ret.add(new LongValueBean(CAPTIONS[i++], stats.getDestroyedSessionCount(interval)));
		
		return ret;
	}
}<commit_msg>fixed min/max values<commit_after>package net.java.dev.moskito.webui.decorators.predefined;

import java.util.ArrayList;
import java.util.List;

import net.java.dev.moskito.core.producers.IStats;
import net.java.dev.moskito.core.stats.TimeUnit;
import net.java.dev.moskito.web.session.SessionCountStats;
import net.java.dev.moskito.webui.bean.LongValueBean;
import net.java.dev.moskito.webui.bean.StatValueBean;
import net.java.dev.moskito.webui.decorators.AbstractDecorator;

public class SessionCountDecorator extends AbstractDecorator{
	private static String CAPTIONS[] = {
		"Cur",
		"Min",
		"Max",
		"New",
		"Del",
	};
	
	private static String SHORT_EXPLANATIONS[] = {
		"Current number of sessions",
		"Min number of sessions",
		"Max number of sessions",
		"Number of created sessions",
		"Number of deleted sessions",
	};


	private static String EXPLANATIONS[] = {
		"Current number of sessions",
		"Min number of sessions",
		"Max number of sessions",
		"Number of created sessions",
		"Number of deleted sessions",
	};

	
	public SessionCountDecorator(){
		super("HttpSession", CAPTIONS, SHORT_EXPLANATIONS, EXPLANATIONS);
	}
	

	@Override public List<StatValueBean> getValues(IStats statsObject, String interval, TimeUnit unit) {
		SessionCountStats stats = (SessionCountStats)statsObject;
		List<StatValueBean> ret = new ArrayList<StatValueBean>(CAPTIONS.length);
		
		int i = 0;
		
		ret.add(new LongValueBean(CAPTIONS[i++], mapToLong(stats.getCurrentSessionCount(interval))));
		ret.add(new LongValueBean(CAPTIONS[i++], mapToLong(stats.getMinSessionCount(interval))));
		ret.add(new LongValueBean(CAPTIONS[i++], mapToLong(stats.getMaxSessionCount(interval))));
		ret.add(new LongValueBean(CAPTIONS[i++], mapToLong(stats.getCreatedSessionCount(interval))));
		ret.add(new LongValueBean(CAPTIONS[i++], mapToLong(stats.getDestroyedSessionCount(interval))));
		
		return ret;
	}
	
	private static final long mapToLong(int value){
		return value == Integer.MAX_VALUE ? Long.MAX_VALUE : 
			   value == Integer.MIN_VALUE ? Long.MIN_VALUE :
				   value;
	}
	
	
}
{'fraction_non_alphanumeric': 0.125, 'fraction_numerical': 0.0005122950819672131, 'mean_word_length': 5.454545454545454, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '3961815', 'n_tokens_mistral': 1382, 'n_tokens_neox': 1270, 'n_words': 260}