Create Performance Scripts for 3-Tier

5
Create Performance Scripts for 3 – Tier (App, Db and Web Server) Topology Step 1: Install Windchill Quality Solution desktop application on App Server and create a database for it on separate DB Server. Step 2: Install Windchill Quality Solution Web application on separate Web Server and point the application to desktop version installed on App Server. Step 3: On Web Server go to C:\Program Files (x86)\PTC\Windchill Quality Solutions 10.0\Web And edit the Web.config file to enable the message logging and tracing. Add the system.diagnostics section as follows: <system.diagnostics> <sources> <source name="System.ServiceModel.MessageLogging" switchValue="Warning, ActivityTracing"> <listeners> <add type="System.Diagnostics.DefaultTraceListener" name="Default"> <filter type="" /> </add> <add name="ServiceModelMessageLoggingListener"> <filter type="" /> </add> </listeners> </source> <source propagateActivity="true" name="System.ServiceModel" switchValue="Off, ActivityTracing"> <listeners> <add type="System.Diagnostics.DefaultTraceListener" name="Default">

description

How to create VSTS performance script.

Transcript of Create Performance Scripts for 3-Tier

Page 1: Create Performance Scripts for 3-Tier

Create Performance Scripts for 3 – Tier (App, Db and Web Server) Topology

Step 1:

Install Windchill Quality Solution desktop application on App Server and create a database for it on separate DB Server.

Step 2:

Install Windchill Quality Solution Web application on separate Web Server and point the application to desktop version installed on App Server.

Step 3:

On Web Server go to C:\Program Files (x86)\PTC\Windchill Quality Solutions 10.0\Web

And edit the Web.config file to enable the message logging and tracing.

Add the system.diagnostics section as follows:

<system.diagnostics> <sources> <source name="System.ServiceModel.MessageLogging" switchValue="Warning, ActivityTracing"> <listeners> <add type="System.Diagnostics.DefaultTraceListener" name="Default"> <filter type="" /> </add> <add name="ServiceModelMessageLoggingListener"> <filter type="" /> </add> </listeners> </source> <source propagateActivity="true" name="System.ServiceModel" switchValue="Off, ActivityTracing"> <listeners> <add type="System.Diagnostics.DefaultTraceListener" name="Default"> <filter type="" /> </add> <add name="ServiceModelTraceListener"> <filter type="" /> </add> </listeners> </source> </sources> <sharedListeners> <add initializeData="C:\Trace\WindchillQualitySolutions_field.svclog" type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"

Page 2: Create Performance Scripts for 3-Tier

name="ServiceModelMessageLoggingListener" traceOutputOptions="Timestamp"> <filter type="" /> </add> <add initializeData="C:\Program Files (x86)\PTC\Windchill Quality Solutions 10.0\Windchill Quality Solutions\WindchillQualitySolutions.Service.ObjectBroker_tracelog.svclog" type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="ServiceModelTraceListener" traceOutputOptions="Timestamp"> <filter type="" /> </add> </sharedListeners> </system.diagnostics>

Also add the diagnostics section in system.servicemodel as follows:

<diagnostics> <messageLogging logEntireMessage="true" logKnownPii="false" logMalformedMessages="false" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="false" maxMessagesToLog="9999999" maxSizeOfMessageToLog="9999999" /> </diagnostics>

Step 4:

Run the Performance scenario manually in Web browser on Web Server two times to get the objects cached.

Step 5:

Delete the trace file generated after manually running the scenario. Now perform the same scenario again. Check that the trace file generated this time would be of lesser memory then the one generated before.

Step 6:

Open the VSTS 2010 and create a new Test Project.

Create a new WCF unit test.

Page 3: Create Performance Scripts for 3-Tier

Step 7:

Use the trace file that was generated while performing the performance scenario manually to create a test.

Page 4: Create Performance Scripts for 3-Tier

Step 8:

Add the following references from the C:\Program Files (x86)\PTC\Windchill Quality Solutions 10.0\Web\bin folder

1. WindchillQualitySolutions.Core.Audit.dll2. WindchillQualitySolutions.Core.BusinessObjects.dll3. WindchillQualitySolutions.Core.DocumentModel.dll4. WindchillQualitySolutions.Core.IX.dll5. WindchillQualitySolutions.Core.License.dll6. WindchillQualitySolutions.Core.Query.dll7. WindchillQualitySolutions.Core.SearchEngine.dll8. WindchillQualitySolutions.Core.SearchIndexer.dll9. WindchillQualitySolutions.Core.Security.dll10. WindchillQualitySolutions.Core.Utility.dll11. WindchillQualitySolutions.Core.WCFData.dll12. WindchillQualitySolutions.Core.Windchill.dll13. WindchillQualitySolutions.Report.WebProxy.dll14. WindchillQualitySolutions.Util.NumCalc.dll15. WindchillQualitySolutions.Util.TextCalc.dll

Step 9:

Once the code is generated add direct Service reference to Silverlight service running on Web Server. “http://i5697-VM12/WindchillQualitySolutions10.0/SilverlightService.svc”

Comment everything in Test Initialize class in WCFUnitTest1.Custom.cs file and add the following code:

System.Net.ServicePointManager.DefaultConnectionLimit = 250; var client = new SilverLightTest.ServiceReference1.SilverlightServiceClient();

foreach (OperationDescription op in client.ChannelFactory.Endpoint.Contract.Operations) { foreach (Type type in KnownTypeEnumerator.GetKnownTypes(null)) { op.KnownTypes.Add(type); }

DataContractSerializerOperationBehavior dataContractBehavior = op.Behaviors.Find<DataContractSerializerOperationBehavior>() as DataContractSerializerOperationBehavior; if (dataContractBehavior != null) { dataContractBehavior.MaxItemsInObjectGraph = 2147483647;

} } silverlightServiceClient = client.ChannelFactory.CreateChannel();

Page 5: Create Performance Scripts for 3-Tier

Step 10:

Substitute the hard coded values with the parameters like the incident id, record number and identifier everywhere in the code.

Run the code.