<commit_before>package com.dianping.cat.report.page.problem;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import com.dianping.cat.consumer.problem.model.entity.Entry;
import com.dianping.cat.consumer.problem.model.entity.JavaThread;
import com.dianping.cat.consumer.problem.model.entity.Machine;
import com.dianping.cat.consumer.problem.model.entity.ProblemReport;
import com.dianping.cat.consumer.problem.model.entity.Segment;

public class ProblemStatistics {

	private Map<String, TypeStatistics> m_status = new LinkedHashMap<String, TypeStatistics>();

	private String m_groupName;

	private String m_threadId;

	public String getSubTitle() {
		StringBuilder sb = new StringBuilder();
		if (isEmpty(m_threadId) && isEmpty(m_groupName)) {
			return "All Thread Groups";
		} else if (!isEmpty(m_groupName) && isEmpty(m_threadId)) {
			return "All Threads in Group:" + m_groupName;
		} else if (!isEmpty(m_groupName) && !isEmpty(m_threadId)) {
			return "Thread :" + m_threadId;
		}
		return sb.toString();
	}

	public String getUrl() {
		StringBuilder sb = new StringBuilder();
		if (!isEmpty(m_groupName)) {
			sb.append("&group=").append(m_groupName);
		}
		if (!isEmpty(m_threadId)) {
			sb.append("&thread=").append(m_threadId);
		}
		return sb.toString();
	}

	public ProblemStatistics displayAll(ProblemReport report, Model model) {
		if (report == null) {
			return null;
		}
		Machine machine = report.getMachines().get(model.getIpAddress());

		if (machine == null) {
			return null;
		}

		// All Level
		Map<String, JavaThread> threads = machine.getThreads();
		for (JavaThread thread : threads.values()) {
			for (Segment segment : thread.getSegments().values()) {
				if (segment == null) {
					continue;
				}
				List<Entry> entries = segment.getEntries();
				statisticsEntries(entries);
			}
		}

		return this;
	}

	public ProblemStatistics display(ProblemReport report, Model model) {
		Machine machine = report.getMachines().get(model.getIpAddress());

		if (machine == null) {
			return null;
		}

		m_groupName = model.getGroupName();<commit_msg>modify the page<commit_after>package com.dianping.cat.report.page.problem;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import com.dianping.cat.consumer.problem.model.entity.Entry;
import com.dianping.cat.consumer.problem.model.entity.JavaThread;
import com.dianping.cat.consumer.problem.model.entity.Machine;
import com.dianping.cat.consumer.problem.model.entity.ProblemReport;
import com.dianping.cat.consumer.problem.model.entity.Segment;

public class ProblemStatistics {

	private Map<String, TypeStatistics> m_status = new LinkedHashMap<String, TypeStatistics>();

	private String m_groupName;

	private String m_threadId;

	public String getSubTitle() {
		StringBuilder sb = new StringBuilder();
		if (isEmpty(m_threadId) && isEmpty(m_groupName)) {
			return "All Thread Groups";
		} else if (!isEmpty(m_groupName) && isEmpty(m_threadId)) {
			return "All Threads in Group:" + m_groupName;
		} else if (!isEmpty(m_groupName) && !isEmpty(m_threadId)) {
			return "Thread :" + m_threadId;
		}
		return sb.toString();
	}

	public String getUrl() {
		StringBuilder sb = new StringBuilder();
		if (!isEmpty(m_groupName)) {
			sb.append("&group=").append(m_groupName);
		}
		if (!isEmpty(m_threadId)) {
			sb.append("&thread=").append(m_threadId);
		}
		return sb.toString();
	}

	public ProblemStatistics displayAll(ProblemReport report, Model model) {
		if (report == null) {
			return null;
		}
		Machine machine = report.getMachines().get(model.getIpAddress());

		if (machine == null) {
			return null;
		}
		// All Level
		Map<String, JavaThread> threads = machine.getThreads();
		for (JavaThread thread : threads.values()) {
			for (Segment segment : thread.getSegments().values()) {
				if (segment == null) {
					continue;
				}
				List<Entry> entries = segment.getEntries();
				statisticsEntries(entries);
			}
		}

		return this;
	}

	public ProblemStatistics display(ProblemReport report, Model model) {
		Machine machine = report.getMachines().get(model.getIpAddress());

		if (machine == null) {
			return null;
		}

		m_groupName = model.getGroupName();
{'fraction_non_alphanumeric': 0.13311460042184203, 'fraction_numerical': 0.0, 'mean_word_length': 4.471794871794872, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '143338', 'n_tokens_mistral': 1521, 'n_tokens_neox': 1343, 'n_words': 287}