<commit_before><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ page import="org.rti.webcgh.util.SystemUtils" %>
<%@ page import="java.util.Properties" %>
<%@ page import="javax.mail.Session" %>
<%@ page import="javax.mail.Transport" %>
<%@ page import="java.sql.*" %>
<%!
boolean isEmpty ( String value ) {
    return value == null || value.length() < 1 ? true : false ;
}
%>
<h1 align="center">webGenome Status</h1>
<h2>Software Release Information</h2>
<pre>
    Current Release Version: rel-2-3-build-6-20061218
</pre>
<h2>Memory Information</h2>
<pre>
<%

// Get current size of heap in bytes
long heapSize = Runtime.getRuntime().totalMemory();

// Get maximum size of heap in bytes. The heap cannot grow beyond this size.
// Any attempt will result in an OutOfMemoryException.
long heapMaxSize = Runtime.getRuntime().maxMemory();

// Get amount of free memory within the heap in bytes. This size will increase
// after garbage collection and decrease as new objects are created.
long heapFreeSize = Runtime.getRuntime().freeMemory();

float percentUsed = ((float) heapSize) / ((float) heapMaxSize) * (float) 100.00 ;

out.println ( "           Heap Size (bytes): " + heapSize ) ;
out.println ( "       Heap Max Size (bytes): " + heapMaxSize ) ;
out.println ( "    Free Heap Memory (bytes): " + heapFreeSize  ) ;
out.println ( "                 Memory Used: " +  percentUsed + " %" ) ;<commit_msg>Added retrieval of build information from the buildInformation.properties properties file - if it is available. buildInformation.properties file contains properties which are collated when the war target is built using the build.xml Ant build script.<commit_after><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ page import="org.rti.webcgh.util.SystemUtils" %>
<%@ page import="java.util.Properties" %>
<%@ page import="javax.mail.Session" %>
<%@ page import="javax.mail.Transport" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.io.InputStream,java.io.IOException" %>
<%!
boolean isEmpty ( String value ) {
    return value == null || value.length() < 1 ? true : false ;
}

String reportBuildProperty ( String label, String propertyKey , Properties properties ) {
	String returnValue = label + ": " ;
	if ( properties != null && properties.getProperty( propertyKey ) != null ) {
	    returnValue += properties.getProperty ( propertyKey ) ;
	}
	else
	    returnValue += "NOT AVAILABLE/NO VALUE DEFINED" ;
	return returnValue ;
}
%>
<h1 align="center">webGenome Status</h1>
<h2>Software Release Information</h2>
<pre>
<%
	String propertiesFile = "buildInformation.properties" ;
	String errorMessage = "Software Release Information not available.\n" +
					      "'" + propertiesFile + "' missing from CLASSPATH.\n" +
	   					  "Uusually this will only be available,\nif you are running this web application packaged as a War file." ;
	try {
		Properties buildProperties = new Properties() ;
		InputStream in = Thread.currentThread().
								getContextClassLoader().getResourceAsStream( propertiesFile );

		if ( in != null ) {
			buildProperties.load( in ) ;
			out.println ( reportBuildProperty ( "Current Build Release", "release.tag", buildProperties ) ) ;
			out.println ( reportBuildProperty ( "           Build Date", "build.date", buildProperties ) ) ;
			out.println ( reportBuildProperty ( "           Build Time", "build.time", buildProperties ) ) ;
			out.println ( reportBuildProperty ( "      Built on (host)", "build.host", buildProperties ) ) ;
			out.println ( reportBuildProperty ( "      Built By (user)", "build.user.name", buildProperties ) ) ;
		}
		else
		    out.println ( errorMessage ) ;
	}
	catch ( IOException e ) {
	    out.println ( errorMessage ) ;
	}
%>

</pre>
<h2>Memory Information</h2>
<pre>
<%

// Get current size of heap in bytes
long heapSize = Runtime.getRuntime().totalMemory();

// Get maximum size of heap in bytes. The heap cannot grow beyond this size.
// Any attempt will result in an OutOfMemoryException.
long heapMaxSize = Runtime.getRuntime().maxMemory();

// Get amount of free memory within the heap in bytes. This size will increase
// after garbage collection and decrease as new objects are created.
long heapFreeSize = Runtime.getRuntime().freeMemory();

float percentUsed = ((float) heapSize) / ((float) heapMaxSize) * (float) 100.00 ;

out.println ( "           Heap Size (bytes): " + heapSize ) ;
out.println ( "       Heap Max Size (bytes): " + heapMaxSize ) ;
out.println ( "    Free Heap Memory (bytes): " + heapFreeSize  ) ;
out.println ( "                 Memory Used: " +  percentUsed + " %" ) ;
{'fraction_non_alphanumeric': 0.1377961312758096, 'fraction_numerical': 0.007607041947402739, 'mean_word_length': 3.691131498470948, 'pattern_counts': {'":': 1, '<': 41, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, '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': '5083528', 'n_tokens_mistral': 1413, 'n_tokens_neox': 1328, 'n_words': 407}