I have to performance/load test a bunch of interdependant services. They all use net.tcp and most use duplex contracts and internal queueing. [handrolled POCO queue class using lock(syncRoot) { if(queue.Empty) Thread.Wait(); }]
Here's the approach I've come up with:
- Identify WCF Services to be performance tested
- Identify the relavant Performance counters for each of the Services
- Identify the logical startpoint that would take the execution through the services being tested
- Auto Generate Unit Tests using VS.Net for each of the services
- Write specific Functional Tests (For example, I can take a use case - "Place an Order" - and write tests that make all the calls to the relevant services and generally excercise pretty much all the functionality needed)
- Use the trace files from running #5 to generate Unit Tests [using WCF Load Test from CodePlex] (This somehow seems to me an ideal tool for recreating user errors in production/field in a debug environment. Disclaimer: Not used the tool. Impressions from reading the project desc)
- The tests above could be tweaked to make the calls with auto generated input data
- Introduce variations to input so different code paths are excercised
- Log data from performance counters
- Analyze and identify bottlenecks
Questions:
- Is there a better approach?
- In case of services that use internal queues, measuring performance using std performance counters, an issue. I may need custom counters?
- If #1 is true, is there a way to introduce customer counters without changing code of the services being tested?
- Should I care about the results of my functional tests?
- Is there a way to [non-intrusively] implement SLAs for WCF services? (I think if I have enough data from my counters such as requests served, exceptions occurred , response time etc., I should be able to validate my SLA - serve 200,000 requests within 5 mins with a response time of 2 seconds for each request - against these figures. My question perhaps is whether I can just specify my SLA and a product / tool could do all of the plumbing behind the scene and get me a tabulated answer? I know... I know... I was day dreaming :))
- Aside: What's the best method to queue requests internally in a WCF Service?