[負載測試] 出現提示訊息「負載測試結果儲存機制空間不足」
測試執行一陣子或者執行時間長/監測項目資料多的時候,測試過程或結束的時候就會出現類似的訊息:
英文版的訊息約略是:
Error occurred running test. Result collection stopped due to the following error: The load test results repository is out of space. Allocate more space to the repository (if possible), or delete results of older load test runs.
解決方法:
清理你儲存測試結果資料庫的SQL Script
USE LoadTest DECLARE @LoadTestRunId int DECLARE OldLoadTestsCursor CURSOR FOR SELECT LoadTestRunId FROM LoadTestRun WHERE datediff(dd, StartTime, getdate()) > 14 OPEN OldLoadTestsCursor FETCH NEXT FROM OldLoadTestsCursor INTO @LoadTestRunId WHILE @@FETCH_STATUS = 0 BEGIN EXEC Prc_DeleteLoadTestRun @LoadTestRunId FETCH NEXT FROM OldLoadTestsCursor INTO @LoadTestRunId END CLOSE OldLoadTestsCursor DEALLOCATE OldLoadTestsCursor
Note1:如果是VS2010的話第一行改成USE LoadTest2010
Note2:這個SQL Script可以刪除14天以前的log,如果想要刪除更近的日期的可以調整第四行最後的數字
Note3:這個SQL Script執行時間可能有點久,要有點耐心...如果是4G滿要全清除的話,我執行約要1hr20min
參考資料:
Load Test results repository is out of space
Deleting old load test results