Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…sus2@641 381d3abc-5231-0410-a0e4-b068e20cbb11
  • Loading branch information
jlward4 committed Mar 31, 2010
1 parent 0c7a86d commit bab2e9f
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 7 deletions.
12 changes: 11 additions & 1 deletion README.txt
Expand Up @@ -3,10 +3,16 @@ Deployment instructions
- Update the jboss/server/default/deployers/jbossws.deployer/META-INF/jboss-beans.xml file: - Update the jboss/server/default/deployers/jbossws.deployer/META-INF/jboss-beans.xml file:
<!--<property name="webServiceHost"></property>--> <!--<property name="webServiceHost"></property>-->


- Add the Valve to jbossweb.sar/server.xml - Add the Valves to jbossweb.sar/server.xml
<Engine name="jboss.web" defaultHost="localhost"> <Engine name="jboss.web" defaultHost="localhost">
<Valve className="com.jamesward.census2.CensusValve"/> <Valve className="com.jamesward.census2.CensusValve"/>


- Update the Connector in the jbossweb.sar/server.xml
<Connector protocol="HTTP/1.1" port="8080" address="${jboss.bind.address}"
connectionTimeout="20000" redirectPort="8443" compression="force"
maxThreads="500" minSpareThreads="100" maxSpareThreads="75"
proxyName="www.jamesward.com" proxyPort="80"/>

- Add the class files from the census2-tests/valve project to jbossweb.sar/ - Add the class files from the census2-tests/valve project to jbossweb.sar/


- Add dependency libs for the Valve to jbossweb.sar/ - Add dependency libs for the Valve to jbossweb.sar/
Expand All @@ -18,3 +24,7 @@ Deployment instructions
- deploy census2-tests.war - deploy census2-tests.war


- deploy census2.war - deploy census2.war

- update the deploy/census2.war/tests.xml file

- update the deploy/census2.war/blazeds_config.xml file
2 changes: 1 addition & 1 deletion client/src/census2.mxml
Expand Up @@ -367,7 +367,7 @@
</mx:itemDoubleClick> </mx:itemDoubleClick>
</mx:List> </mx:List>
<mx:Spacer height="10"/> <mx:Spacer height="10"/>
<controls:LabelLink url="http://www.jamesward.com/blog/census" label="Learn more about Census"/> <controls:LabelLink url="http://www.jamesward.com/ria-benchmark" label="Learn more about Census"/>
</mx:VBox> </mx:VBox>
<mx:VBox width="100%" height="100%" horizontalAlign="center" verticalGap="0" paddingTop="40" paddingLeft="0" paddingRight="20" paddingBottom="10"> <mx:VBox width="100%" height="100%" horizontalAlign="center" verticalGap="0" paddingTop="40" paddingLeft="0" paddingRight="20" paddingBottom="10">
<mx:HRule width="100%"/> <mx:HRule width="100%"/>
Expand Down
4 changes: 2 additions & 2 deletions client/src/com/jamesward/census2/utils/TextFormatters.as
Expand Up @@ -44,7 +44,7 @@ public class TextFormatters
} }
else if (n >= 1000) else if (n >= 1000)
{ {
if ((n % 10) == 0) if ((n % 1000) == 0)
{ {
nf.precision = 0; nf.precision = 0;
} }
Expand Down Expand Up @@ -72,7 +72,7 @@ public class TextFormatters


if (n >= 1000) if (n >= 1000)
{ {
if ((n % 10) == 0) if ((n % 1000) == 0)
{ {
nf.precision = 0; nf.precision = 0;
} }
Expand Down
Expand Up @@ -52,7 +52,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</mx:verticalAxisRenderers> </mx:verticalAxisRenderers>


<mx:horizontalAxis> <mx:horizontalAxis>
<mx:LinearAxis id="bcHA" labelFunction="TextFormatters.byteFormat"/> <mx:LinearAxis id="bcHA" labelFunction="TextFormatters.byteFormat" minimum="0"/>
</mx:horizontalAxis> </mx:horizontalAxis>


<mx:horizontalAxisRenderers> <mx:horizontalAxisRenderers>
Expand Down
Expand Up @@ -52,7 +52,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</mx:verticalAxisRenderers> </mx:verticalAxisRenderers>


<mx:horizontalAxis> <mx:horizontalAxis>
<mx:LinearAxis id="bcHA" labelFunction="TextFormatters.byteFormat"/> <mx:LinearAxis id="bcHA" labelFunction="TextFormatters.byteFormat" minimum="0"/>
</mx:horizontalAxis> </mx:horizontalAxis>


<mx:horizontalAxisRenderers> <mx:horizontalAxisRenderers>
Expand Down
Binary file modified server/WebContent/CensusDashboard.swf
Binary file not shown.
Binary file modified server/WebContent/census2.swf
Binary file not shown.
Binary file modified server/WebContent/readable.swf
Binary file not shown.
Binary file modified server/WebContent/sexy.swf
Binary file not shown.
18 changes: 17 additions & 1 deletion server/src/com/jamesward/census2/SendCensusResult.java
Expand Up @@ -27,6 +27,22 @@ public void doGet(HttpServletRequest request, HttpServletResponse response)
String testId = request.getParameter("testId"); String testId = request.getParameter("testId");
String resultType = request.getParameter("resultType"); String resultType = request.getParameter("resultType");


String ipAddress;

if (request.getParameter("ipAddress") != null)
{
ipAddress = request.getParameter("ipAddress");
}
else if (request.getHeader("X-Forwarded-For") != null)
{
ipAddress = request.getHeader("X-Forwarded-For");
}
else
{
ipAddress = request.getRemoteAddr();
}


Boolean gzip = false; Boolean gzip = false;


if (request.getParameter("gzip").equals("true")) if (request.getParameter("gzip").equals("true"))
Expand All @@ -47,7 +63,7 @@ public void doGet(HttpServletRequest request, HttpServletResponse response)
else else
{ {
// save the results to DB // save the results to DB
CensusResult newCensusResult = new CensusResult(request.getRemoteAddr(), testId, resultType, resultData, gzip, numRows); CensusResult newCensusResult = new CensusResult(ipAddress, testId, resultType, resultData, gzip, numRows);


ObjectContainer db4oServer = (ObjectContainer)getServletContext().getAttribute(Db4oServletContextListener.KEY_DB4O_SERVER); ObjectContainer db4oServer = (ObjectContainer)getServletContext().getAttribute(Db4oServletContextListener.KEY_DB4O_SERVER);
// check for dups - only allow one entry per IP per testId per resultType // check for dups - only allow one entry per IP per testId per resultType
Expand Down

0 comments on commit bab2e9f

Please sign in to comment.