├── .classpath
├── .gitignore
├── .jazzignore
├── .project
├── .settings
├── org.eclipse.jdt.core.prefs
├── org.eclipse.wst.common.component
└── org.eclipse.wst.common.project.facet.core.xml
├── README.md
├── WebContent
├── META-INF
│ └── MANIFEST.MF
├── PingHtml.html
├── PingJsp.jsp
├── PingJspEL.jsp
├── PingServlet2Jsp.jsp
├── WEB-INF
│ ├── lib
│ │ └── com.ibm.json4j.jar
│ └── web.xml
├── account.jsp
├── accountImg.jsp
├── clearCookies.jsp
├── config.jsp
├── configure.htmlx
├── configure.jsp
├── contentHome.html
├── css
│ └── bootstrap.min.css
├── displayQuote.jsp
├── docs
│ ├── benchmarking.html
│ ├── documentation.html
│ ├── glossary.html
│ ├── rtCharacterisitics.html
│ ├── tradeFAQ.html
│ ├── tradeTech.pdf
│ ├── tradeUML.pdf
│ └── tradeversion.html
├── error.jsp
├── generateOOM.jsp
├── header.html
├── images
│ ├── .picasa.ini
│ ├── .picasaoriginals
│ │ ├── .picasa.ini
│ │ └── 10.jpg
│ ├── IBMBackGround1.gif
│ ├── IBMBackGround2.gif
│ ├── SOAPconfig.gif
│ ├── WEBSPHERE_18P_UNIX.GIF
│ ├── account.gif
│ ├── arrowdown.gif
│ ├── arrowup.gif
│ ├── daytrader_simple_arch.png
│ ├── graph.gif
│ ├── gridx2.png
│ ├── home.gif
│ ├── homeBanner.gif
│ ├── ibmlogo.png
│ ├── lanim.gif
│ ├── line.gif
│ ├── logout.gif
│ ├── portfolio.gif
│ ├── profile1.jpg
│ ├── profile2.jpg
│ ├── quotes.gif
│ ├── ticker-anim.gif
│ ├── topline.jpg
│ ├── tradeLogo.gif
│ ├── tradeLogoSmall.gif
│ └── tradeTopology.gif
├── index.html
├── index.htmlx
├── leftMenu.html
├── marketSummary.jsp
├── order.jsp
├── orderImg.jsp
├── port.jsp
├── portfolio.jsp
├── portfolioImg.jsp
├── quote.jsp
├── quoteImg.jsp
├── register.jsp
├── registerImg.jsp
├── runStats.jsp
├── setup_db.sql
├── socialFeed.html
├── stress.jsp
├── style.css
├── style2.css
├── topBanner.html
├── tradehome.jsp
├── tradehomeImg.jsp
├── web_prmtv.html
├── welcome.jsp
├── welcome.jspx
└── welcomeImg.jsp
├── diagram.png
├── pom.xml
├── src
└── com
│ └── ibm
│ └── samples
│ └── trade
│ ├── AccountDataBean.java
│ ├── AccountProfileDataBean.java
│ ├── HoldingDataBean.java
│ ├── MarketSummaryDataBean.java
│ ├── MarketSummaryDataBeanWS.java
│ ├── OrderDataBean.java
│ ├── QuoteDataBean.java
│ ├── RunStatsDataBean.java
│ ├── TradeConfig.java
│ ├── TradeServices.java
│ ├── direct
│ ├── KeySequenceDirect.java
│ └── TradeDirect.java
│ ├── util
│ ├── FinancialUtils.java
│ ├── KeyBlock.java
│ ├── Log.java
│ ├── MDBStats.java
│ └── TimerStat.java
│ └── web
│ ├── GenerateOOM.java
│ ├── OrdersAlertFilter.java
│ ├── TestServlet.java
│ ├── TradeAppServlet.java
│ ├── TradeBuildDB.java
│ ├── TradeConfigServlet.java
│ ├── TradeScenarioServlet.java
│ ├── TradeServletAction.java
│ ├── TradeWebContextListener.java
│ └── prims
│ ├── PingBean.java
│ ├── PingJDBCRead.java
│ ├── PingJDBCWrite.java
│ ├── PingServlet.java
│ ├── PingServlet2Include.java
│ ├── PingServlet2IncludeRcv.java
│ ├── PingServlet2JNDI.java
│ ├── PingServlet2Jsp.java
│ ├── PingServlet2Servlet.java
│ ├── PingServlet2ServletRcv.java
│ ├── PingServletWriter.java
│ ├── PingSession1.java
│ ├── PingSession2.java
│ ├── PingSession3.java
│ └── PingSession3Object.java
└── xdocs
├── cleardb_screenshot.png
└── populate_screenshot.png
/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
PING HTML:
8 |Hello World
9 | 10 | 11 | -------------------------------------------------------------------------------- /WebContent/PingJsp.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |Hit Count: <%= hitCount %>
20 | 21 | 22 | -------------------------------------------------------------------------------- /WebContent/PingJspEL.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |46 | Hit Count: <%= hitCount++ %> 47 |
48 |
51 |
52 | someint1 = <%= someint1 %>
53 | someint2 = <%= someint2 %>
54 | somefloat1 = <%= somefloat1 %>
55 | somefloat2 = <%= somefloat2 %>
56 |
57 |
58 | 59 |
EL Type | 64 |EL Expressions | 65 |Result | 66 | 67 |
Integer Arithmetic | 69 |\${someint1 + someint2 - someint1 * someint2 mod someint1} | 70 |${someint1 + someint2 - someint1 * someint2 mod someint1} | 71 |
Floating Point Arithmetic | 74 |\${somefloat1 + somefloat2 - somefloat1 * somefloat2 / somefloat1} | 75 |${somefloat1 + somefloat2 - somefloat1 * somefloat2 / somefloat1} | 76 |
Logical Operations | 79 |\${(someint1 < someint2) && (someint1 <= someint2) || (someint1 == someint2) && !Boolean.FALSE} | 80 |${(someint1 < someint2) && (someint1 <= someint2) || (someint1 == someint2) && !Boolean.FALSE} | 81 |
Indexing Operations | 84 |
85 | \${quoteData3.symbol} 86 | \${quoteData[2].symbol} 87 | \${quoteData4["symbol"]} 88 | \${header["host"]} 89 | \${header.host} 90 | |
91 |
92 | ${quoteData3.symbol} 93 | ${quoteData[1].symbol} 94 | ${quoteData4["symbol"]} 95 | ${header["host"]} 96 | ${header.host} 97 | |
98 |
Variable Scope Tests | 101 |
102 | \${(quoteData3 == null) ? "null" : quoteData3} 103 | \${(noSuchVariableAtAnyScope == null) ? "null" : noSuchVariableAtAnyScope} 104 | |
105 |
106 | ${(quoteData3 == null) ? "null" : quoteData3} 107 | ${(noSuchVariableAtAnyScope == null) ? "null" : noSuchVariableAtAnyScope} 108 | |
109 |
16 | Configuration utilities17 | |
18 | 19 | |
Benchmark Configuration 28 | Tools |
29 | Description | 30 |
Reset Trade 33 | (to be done before each run) |
34 | Reset the Trade runtime to a clean starting 35 | point by logging off all users, removing 36 | new registrations and other general cleanup. 37 | Also refreshes the DB schema. 38 | For consistent results this URL should be 39 | run before each Trade run. | 40 |
Configure Trade run-time parameters | 43 |This link provides an interface to set configuration 44 | parameters that control Trade run-time characteristics 45 | such as using EJBs or JDBC. This link also 46 | provides utilities such as setting the UID 47 | and Password for a remote or protected database 48 | when using JDBC. | 49 |
(Re)-populate Trade Database 52 | 53 | | 54 |This link is used to initially populate or re-populate the Trade database with fictitious users (uid:0, uid:1, ...) and stocks (s:0, s:1, ...). First all existing users and stocks are deleted (if any). The database is then populated with a new set of Trade users and stocks. | 55 |
Test Trade Scenario | 58 |This links pops up a browser to manually 59 | step through a Trade scenario by hitting 60 | "Reload" on your browser | 61 |
Trade Version | 76 |Trade application version and change history 77 | information | 78 |
81 | | 82 | |
58 | Configuration Utilities59 | Running on port <%=port %> , instance ID : <%= instance_id %> 60 |61 | |
62 | |
Configuration Tools | 65 |Description 66 | | 67 |
(Re)-populate Database | 98 |This link is used to initially populate or re-populate the 99 | database with fictitious users (uid:0, uid:1, ...) and 100 | stocks (s:0, s:1, ...). First all existing users and stocks are 101 | deleted (if any). The database is then populated with a new set of 102 | users and stocks. This option does not drop and recreate the 103 | db tables. | 104 |
Generate Out Of Memory failure | 107 |This link will cause an OOM and kill the server of one (not necessarily this) application instance. If you have multiple instances, re-visit the application immediately after the OOM to get redirected to another instance. The killed instance should restart in a few minutes. | 108 |
Stress test | 111 |Run a script which will generate mock load on the server by logging in with multiple users and issuing trades. | 112 |
VCAP_SERVICES | 115 |116 | | 123 |
33 | This 34 | sample is a collection of Java classes, Java Servlets, Java Server Pages. This application is meant to be deployed onto the cloud, and use services provided by the cloud. At a minimum, a SQLDB service is required.35 |
|
37 |
40 | 41 | |
42 |
16 | Benchmarking17 | |
18 |
Trade provides two servlets to create a workload for benchmarking: TradeApp servlet and TradeScenario servlet. 24 | In either case, the load generation tool used to drive the Trade workload must provide cookie support to handle 25 | HTTP sessions.
26 |TradeApp servlet provides the standard web interface and 27 | can be accessed with the Go Trade! link. Driving benchmark load using this 28 | interface requires a sophisticated web load 29 | generator that is capable of filling HTML 30 | forms and posting dynamic data.
31 |TradeScenario servlet emulates a population of web users by generating 32 | a specific Trade operation for a randomly 33 | chosen user on each access to the URL. Test 34 | this servlet by clicking Trade Scenario and hit "Reload" on your browser to step through a Trade Scenario. 35 | To benchmark using this URL aim your favorite web load generator at the 36 | Trade Scenario URL and fire away.
37 |There is a drawback to using the Trade Scenario 38 | servlet to drive the workload versus using a series of more complicated 39 | load scripts. As previously mentioned, the scenario 40 | servlet is responsible for managing clients and emulating user 41 | operations by dispatching simple client requests to complex Trade 42 | actions. This causes the application server to spend a large percentage 43 | of time performing work that would typically be handled by a client or 44 | a more complex load driver. Consequently, performance numbers are 45 | artificially deflated when using Trade Scenario servlet as compared to 46 | driving the workload directly.
47 | 48 | 49 |A set of automated Web Primitives is also provided. The web primitives leverage the Trade infrastructure to test specific features of the web application development environment. This provides basic worloads for servlets, JSPs, EJBs, MDBs and more. The Web Primitives are installed automatically with the Trade package.
51 |
16 | Technical Documentation17 | |
18 |
Documents below provide documentation on Trade application design, runtime 25 | characteristics and FAQs.
26 |27 |50 |28 | 29 |
49 |30 | 33 |Trade Technical Overview 31 |Provides an overview of the Trade application design, configuration, and usage 32 |34 | 37 |Trade UML Diagrams 35 |UML diagrams showing application architecture 36 |38 | 41 |FAQ 39 |Frequently Asked Questions 40 |42 | 46 | 47 | 48 |Runtime and Database 44 |
43 | Usage CharacteristicsDetails runtime characteristics and database operations 45 |
17 | Trade Glossary and Terms18 | |
19 | 20 | |
Trade Runtime and Database Usage Characteristics | 16 |
The table below details each of the high level user operations in the Trade
21 | application.
22 |
Trade Action | 33 |Description | 34 |Complexity | 35 |HTTP Session | 36 |DB Activity 37 | (C, R, U, D) |
38 |
39 |
Login | 41 |User sign in, session creation, market summary | 42 |Servlet, JSP, 43 | Session EJB 44 | CMP Beans Read, Update, Collections |
45 | Create, Update | 46 |Account: R, U 47 | AccountProfile: R 48 | Quote: RC *3 |
49 |
50 |
Logout | 52 |Use sign-off, session destroy | 53 |Servlet, JSP, 54 | Session EJB 55 | CMP Bean Read, Update |
56 | Read, Destroy | 57 |Account: R, U 58 | AccountProfile: R |
59 |
60 |
Buy | 62 |Quote followed buy a security purchase | 63 |Servlet, JSP, 64 | Session EJB 65 | Message Driven Beans (Queue and Pub/Sub) 66 | Multi CMP Read/Update |
67 | Read | 68 |Quote: R 69 | Account: R, U 70 | Holding: C, R, U Orders: C, R, U 71 | |
72 |
73 |
Sell | 75 |Portfolio followed by the sell of a holding | 76 |Servlet, JSP, 77 | Session EJB 78 | Message Driven Beans (Queue and Pub/Sub) Multi CMP Read/Update |
79 | Read | 80 |Quote: R 81 | Account: R, U 82 | Holding: D, R Orders: R, U |
83 |
84 |
85 |
Register | 87 |Create a new user profile and account | 88 |Servlet, JSP, 89 | Session EJB 90 | CMP Bean Creates |
91 | Create, Update | 92 |Account: C, R 93 | AccountProfile: C |
94 |
95 |
Home | 97 |Personalized home page including current market conditions in a detailed market summary | 98 |Servlet, JSP, 99 | Session EJB 100 | CMP Bean Read, Collections |
101 | Read | 102 |Account: R AccountProfile: R Quote: RC *3 |
103 |
104 |
Account | 106 |Review current user account and profile information along with recent orders | 107 |Servlet, JSP, 108 | Session EJB 109 | CMP Bean Read, Collections |
110 | Read | 111 |Account: R AccountProfile: R Orders: RC |
112 |
113 |
Account Update | 115 |Account followed by user profile update | 116 |Servlet, JSP, 117 | Session EJB 118 | CMP Bean Read/Update, Collections |
119 | Read | 120 |Account: R AccountProfile: R, U Orders: RCQuote: RC |
121 |
122 |
Portfolio | 124 |View users current security holdings | 125 |Servlet, JSP, 126 | Session EJB 127 | CMP Bean Read, Collections |
128 | Read | 129 |Holding: RC 130 | Quote: RC |
131 |
132 |
Quotes | 134 |View an arbirtray list of current security quotes | 135 |Servlet, JSP 136 | Cached CMP Bean Read, Collections |
137 | Read | 138 |Quote: RC | 139 | 140 |
11 | |
12 | 13 | |
14 | 15 | |
18 | | An Error has occured during Trade processing. 19 | The stack trace detailing the error follows. 20 | Please consult the application server error logs (SystemOut.log/SystemErr.log/FFDC) for further details. 21 | |
22 | 23 | |
26 |
27 | <%
28 | String message = null;
29 | int status_code = -1;
30 | String exception_info = null;
31 | String url = null;
32 |
33 | try {
34 | Exception theException = null;
35 | Integer status = null;
36 |
37 | //these attribute names are specified by Servlet 2.2
38 | message = (String) request.getAttribute("javax.servlet.error.message");
39 | status = ((Integer) request.getAttribute("javax.servlet.error.status_code"));
40 | theException = (Exception) request.getAttribute("javax.servlet.error.exception");
41 | url = (String) request.getAttribute("javax.servlet.error.request_uri");
42 |
43 | // convert the stack trace to a string
44 | StringWriter sw = new StringWriter();
45 | PrintWriter pw = new PrintWriter(sw);
46 | theException.printStackTrace(pw);
47 | pw.flush();
48 | pw.close();
49 |
50 | if (message == null) {
51 | message = "not available";
52 | }
53 |
54 | if (status == null) {
55 | status_code = -1;
56 | }
57 | else {
58 | status_code = status.intValue();
59 | }
60 | if (theException == null) {
61 | exception_info = "not available";
62 | }
63 | else {
64 | exception_info = theException.toString();
65 | exception_info = exception_info + " " + sw.toString(); 66 | sw.close(); 67 | } 68 | } catch (Exception e) { 69 | e.printStackTrace(); 70 | } 71 | 72 | out.println(" Processing request:" + url); 73 | out.println(" StatusCode: " + status_code); 74 | out.println(" Message:" + message); 75 | out.println(" Exception:" + exception_info); 76 | 77 | %> 78 | 79 | |
80 | ||
83 | | ||
86 | 87 | |
88 |
23 |
24 |
25 |
Market Summary | 13 ||||||||
Trade Stock Index (TSIA) | 16 |<%= marketSummaryData.getTSIA() %> <%= FinancialUtils.printGainPercentHTML(marketSummaryData.getGainPercent()) %> | 17 |||||||
Trading Volume | 20 |<%= marketSummaryData.getVolume() %> | 21 |||||||
Top Gainers | 24 |
25 |
|
51 | ||||||
Top Losers | 54 |
55 |
|
82 |
Trade Home | 22 |Trade | 23 |
30 | | <%= results==null ? blank : results %> | 31 |32 | |
39 | | Register
40 | 41 | |
42 |
108 | 109 | |
110 | |
113 | | |
Trade Home | 116 |Trade | 117 |
Created with IBM WebSphere Application Server and WebSphere Studio Application Developer 120 | 121 | 122 | Copyright 2000, IBM Corporation |
123 |
Trade Register | 22 |![]() |
23 |
30 | | <%= results==null ? blank : results %> | 31 |![]() |
32 |
39 | | Register
40 | 41 | |
42 |
108 | 109 | |
110 | |
113 | | |
Trade Register | 116 |![]() |
117 |
Created with IBM WebSphere Application Server and WebSphere Studio Application Developer 120 | 121 | 122 | Copyright 2000, IBM Corporation |
123 |
5 | ![]() |
7 |
8 | Bought IBM @ 184.61
9 | A no brainer after playing with Bluemix
10 |
11 | |
15 | ![]() |
17 |
18 | Should I keep YRD??
19 | The recent earnings don't look very good :(
20 |
21 | |
![]() 15 | Performance Application |
16 | ![]() 17 | ![]() |
18 | |
WebSphere Performance Benchmark Sample | 21 |
32 | | <% String results; 33 | results = (String) request.getAttribute("results"); 34 | if ( results != null )out.print(results); 35 | %> | 36 |37 | |
Trade Login | 13 |Trade | 14 |
21 | | <% String results; 22 | results = (String) request.getAttribute("results"); 23 | if ( results != null )out.print(results); 24 | %> | 25 |26 | |
34 | | Log in
35 | 36 | |
37 |
Username 40 | Password 41 | 42 | 43 | | 44 ||
47 | 48 | | 49 |
56 | |
57 | 58 | |
59 |
62 | | First time user? Please Register | 63 |
66 | | 67 ||
70 | 71 | Register With Trade 72 |73 | |
74 | |
77 | 78 | |
79 |
86 | 87 | |
88 | |
91 | | |
Trade Login | 94 |Trade | 95 |
Created with IBM WebSphere Application Server and WebSphere Studio Application Developer 98 | 99 | 100 | Copyright 2000, IBM Corporation |
101 |
Trade Login | 13 |![]() |
14 |
<% String results; 22 | results = (String) request.getAttribute("results"); 23 | if ( results != null )out.print(results); 24 | %> | 25 |26 | | ![]() |
27 |
35 | | Log in
36 | 37 | |
38 |
Username 41 | Password 42 | 43 | 44 | | 45 ||
48 | 49 | | 50 |
57 | |
58 | 59 | |
60 |
63 | | First time user? Please Register | 64 |
67 | | 68 ||
71 | 72 | Register With Trade 73 |74 | |
75 | |
78 | 79 | |
80 |
87 | 88 | |
89 | |
92 | 93 | ![]() |
94 | |
Trade Login | 97 |![]() |
98 |
Created with IBM WebSphere Application Server and WebSphere Studio Application Developer 101 | 102 | 103 | Copyright 2000, IBM Corporation |
104 |