2014-02-05 39 views
1

有沒有辦法在VisualStudio中的負載測試期間編寫自定義事務時間。通常記錄的交易時間,你把交易BeginTimer和EndTimer方法,如下面之間:在Visual Studio負載測試期間編寫自定義事務時間

TestContext.BeginTimer("TransactionName"); 
// Do stuff for the transaction here 
TestContext.EndTimer("TransactionName"); 

在我的代碼,我已經有存儲交易的時機。有沒有辦法讓我報告這個?類似這樣的:

WriteTimer("TransactionName", time); 

我希望看到Visual Studio創建的測試摘要中的結果。

回答

1

使用的BeginTransaction和地方BeginTimer和EndTimer EndTransaction方法:

TestContext.BeginTransaction ("TransactionName"); 
// Do stuff for the transaction here 
TestContext.EndTransaction ("TransactionName"); 

爲「TransactionName」的結果將顯示在測試總結。

+0

它是否也會添加到LoadTest數據庫中?如果不是我們怎麼能添加它? – eetawil

相關問題