<commit_before><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
--%>
<HTML>
<HEAD>
<META http-equiv="Content-Style-Type" content="text/css">
<TITLE>Welcome to Trade</TITLE>
</HEAD>
<BODY bgcolor="#ffffff" link="#000099">
<%@ page import="org.apache.aries.samples.ariestrader.util.*"
	session="false" isThreadSafe="true" isErrorPage="false"%>

<jsp:useBean
	class="org.apache.aries.samples.ariestrader.api.persistence.RunStatsDataBean"
	id="runStatsData" scope="request" />
<% 
double loginPercentage = (double) ((TradeConfig.getScenarioMixes())[TradeConfig.workloadMix][TradeConfig.LOGOUT_OP]) / 100.0;
double logoutPercentage = (double) ((TradeConfig.getScenarioMixes())[TradeConfig.workloadMix][TradeConfig.LOGOUT_OP]) / 100.0;
double buyOrderPercentage = (double) ((TradeConfig.getScenarioMixes())[TradeConfig.workloadMix][TradeConfig.BUY_OP]) / 100.0;
double sellOrderPercentage = (double) ((TradeConfig.getScenarioMixes())[TradeConfig.workloadMix][TradeConfig.SELL_OP]) / 100.0;
double orderPercentage = buyOrderPercentage + sellOrderPercentage;
double registerPercentage = (double) ((TradeConfig.getScenarioMixes())[TradeConfig.workloadMix][TradeConfig.REGISTER_OP]) / 100.0;
                                                            
int logins = runStatsData.getSumLoginCount()-runStatsData.getTradeUserCount(); //account for each user being logged in up front
if (logins < 0 ) logins = 0; //no requests before reset
//double expectedRequests = ((double) logins) / loginPercentage;
double expectedRequests = (double)TradeConfig.getScenarioCount();
TradeConfig.setScenarioCount(0);

int verifyPercent = TradeConfig.verifyPercent;
%>
<%!// verifies 2 values are w/in tradeConfig.verifyPercent percent
String verify(double expected, double actual, int verifyPercent)
{
	String retVal = "";
	if ( (expected==0.0) || (actual == 0.0) )
		return "N/A";
	double check = (actual / expected) * 100 - 100;
	//PASS
	retVal += check +"% ";
	if ( (check>=(-1.0*verifyPercent)) && (check<=verifyPercent) )
		retVal += " Pass";
	else 
		retVal += " Fail<SUP>4</SUP>";
	if (check > 0.0)
		retVal = "+" + retVal;
//System.out.println("verify --- expected="+expected+" actual="+actual+ " check="+check);		
	return retVal;
}
String verify(int expected, int actual, int verifyPercent)
{
	return verify((double)expected, (double)actual, verifyPercent);
}
%>
<DIV align="left">

<TABLE style="font-size: smaller">
	<TBODY>
		<TR>
			<TD bgcolor="#c93333" align="left" width="640" height="10" colspan=5><B><FONT
				color="#ffffff">AriesTrader Scenario Runtime Statistics</FONT></B></TD>
			<TD align="center" bgcolor="#000000" width="100" height="10"><FONT
				color="#ffffff"><B>AriesTrader</B></FONT></TD>
		</TR>
	</TBODY>
</TABLE>
<TABLE width="639" height="30">
	<TBODY>
		<TR>
			<TD width="228"><B><FONT size="-1" color="#cc0000"><% 
String status;
status = (String) request.getAttribute("status");
if ( status != null )out.print(status);
%></FONT></B></TD>
			<TD width="202"></TD>
			<TD width="187" align="right"><FONT size="-1"><A href="config"
				target="_self">Modify runtime configuration</A></FONT></TD>
		</TR>
	</TBODY>
</TABLE>
</DIV>
<TABLE width="645">
	<TBODY>
		<TR>
			<TD valign="top" width="643">
			<TABLE width="100%">
				<TBODY>
					<TR align="center">
						<TD colspan="6">
						<CENTER></CENTER>
						<TABLE border="1" style="font-size: smaller" cellpadding="2"
							cellspacing="0">
							<COL span="1" align="right">
							<COL span="1">
							<COL span="3" align="center">
							<CAPTION align="bottom"><FONT size="+1"><B>Benchmark scenario
							statistics</B></FONT></CAPTION>
							<TBODY>
								<TR bgcolor="#f3f3f3">
									<TD colspan="2" align="center"><B>Benchmark runtime
									configuration summary</B></TD>
									<TD colspan="3"><B>Value </B></TD>
								</TR>
								<TR>
									<TD colspan="2"><A href="docs/glossary.html">Run-Time Mode</A></TD>
									<TD colspan="3"><B><%= (TradeConfig.getRunTimeModeNames())[TradeConfig.runTimeMode] %></B></TD>
								</TR>
								<TR>
									<TD colspan="2"><A href="docs/glossary.html">Order-Processing
									Mode</A></TD>
									<TD colspan="3"><B><%= (TradeConfig.getOrderProcessingModeNames())[TradeConfig.orderProcessingMode]%></B></TD>
								</TR>
								<TR>
									<TD colspan="2"><A href="docs/glossary.html">Scenario Workload
									Mix</A></TD><commit_msg>AriesTrader - Fix a bad reference to runTimeMode for runStats jsp<commit_after><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
--%>
<HTML>
<HEAD>
<META http-equiv="Content-Style-Type" content="text/css">
<TITLE>Welcome to Trade</TITLE>
</HEAD>
<BODY bgcolor="#ffffff" link="#000099">
<%@ page import="org.apache.aries.samples.ariestrader.util.*"
	session="false" isThreadSafe="true" isErrorPage="false"%>

<jsp:useBean
	class="org.apache.aries.samples.ariestrader.api.persistence.RunStatsDataBean"
	id="runStatsData" scope="request" />
<% 
double loginPercentage = (double) ((TradeConfig.getScenarioMixes())[TradeConfig.workloadMix][TradeConfig.LOGOUT_OP]) / 100.0;
double logoutPercentage = (double) ((TradeConfig.getScenarioMixes())[TradeConfig.workloadMix][TradeConfig.LOGOUT_OP]) / 100.0;
double buyOrderPercentage = (double) ((TradeConfig.getScenarioMixes())[TradeConfig.workloadMix][TradeConfig.BUY_OP]) / 100.0;
double sellOrderPercentage = (double) ((TradeConfig.getScenarioMixes())[TradeConfig.workloadMix][TradeConfig.SELL_OP]) / 100.0;
double orderPercentage = buyOrderPercentage + sellOrderPercentage;
double registerPercentage = (double) ((TradeConfig.getScenarioMixes())[TradeConfig.workloadMix][TradeConfig.REGISTER_OP]) / 100.0;
                                                            
int logins = runStatsData.getSumLoginCount()-runStatsData.getTradeUserCount(); //account for each user being logged in up front
if (logins < 0 ) logins = 0; //no requests before reset
//double expectedRequests = ((double) logins) / loginPercentage;
double expectedRequests = (double)TradeConfig.getScenarioCount();
TradeConfig.setScenarioCount(0);

int verifyPercent = TradeConfig.verifyPercent;
%>
<%!// verifies 2 values are w/in tradeConfig.verifyPercent percent
String verify(double expected, double actual, int verifyPercent)
{
	String retVal = "";
	if ( (expected==0.0) || (actual == 0.0) )
		return "N/A";
	double check = (actual / expected) * 100 - 100;
	//PASS
	retVal += check +"% ";
	if ( (check>=(-1.0*verifyPercent)) && (check<=verifyPercent) )
		retVal += " Pass";
	else 
		retVal += " Fail<SUP>4</SUP>";
	if (check > 0.0)
		retVal = "+" + retVal;
//System.out.println("verify --- expected="+expected+" actual="+actual+ " check="+check);		
	return retVal;
}
String verify(int expected, int actual, int verifyPercent)
{
	return verify((double)expected, (double)actual, verifyPercent);
}
%>
<DIV align="left">

<TABLE style="font-size: smaller">
	<TBODY>
		<TR>
			<TD bgcolor="#c93333" align="left" width="640" height="10" colspan=5><B><FONT
				color="#ffffff">AriesTrader Scenario Runtime Statistics</FONT></B></TD>
			<TD align="center" bgcolor="#000000" width="100" height="10"><FONT
				color="#ffffff"><B>AriesTrader</B></FONT></TD>
		</TR>
	</TBODY>
</TABLE>
<TABLE width="639" height="30">
	<TBODY>
		<TR>
			<TD width="228"><B><FONT size="-1" color="#cc0000"><% 
String status;
status = (String) request.getAttribute("status");
if ( status != null )out.print(status);
%></FONT></B></TD>
			<TD width="202"></TD>
			<TD width="187" align="right"><FONT size="-1"><A href="config"
				target="_self">Modify runtime configuration</A></FONT></TD>
		</TR>
	</TBODY>
</TABLE>
</DIV>
<TABLE width="645">
	<TBODY>
		<TR>
			<TD valign="top" width="643">
			<TABLE width="100%">
				<TBODY>
					<TR align="center">
						<TD colspan="6">
						<CENTER></CENTER>
						<TABLE border="1" style="font-size: smaller" cellpadding="2"
							cellspacing="0">
							<COL span="1" align="right">
							<COL span="1">
							<COL span="3" align="center">
							<CAPTION align="bottom"><FONT size="+1"><B>Benchmark scenario
							statistics</B></FONT></CAPTION>
							<TBODY>
								<TR bgcolor="#f3f3f3">
									<TD colspan="2" align="center"><B>Benchmark runtime
									configuration summary</B></TD>
									<TD colspan="3"><B>Value </B></TD>
								</TR>
								<TR>
									<TD colspan="2"><A href="docs/glossary.html">Run-Time Mode</A></TD>
									<TD colspan="3"><B><%= (TradeConfig.getRunTimeModeNames())[TradeConfig.getRunTimeMode().ordinal()] %></B></TD>
								</TR>
								<TR>
									<TD colspan="2"><A href="docs/glossary.html">Order-Processing
									Mode</A></TD>
									<TD colspan="3"><B><%= (TradeConfig.getOrderProcessingModeNames())[TradeConfig.orderProcessingMode]%></B></TD>
								</TR>
								<TR>
									<TD colspan="2"><A href="docs/glossary.html">Scenario Workload
									Mix</A></TD>
{'fraction_non_alphanumeric': 0.16661884265901483, 'fraction_numerical': 0.023146819703491153, 'mean_word_length': 4.083130772970345, 'pattern_counts': {'":': 0, '<': 235, '<?xml version=': 0, '>': 235, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '681587', 'n_tokens_mistral': 4009, 'n_tokens_neox': 3341, 'n_words': 796}