mirror of https://github.com/oxen-io/session-ios
				
				
				
			
			You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
	
	
		
			43 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Swift
		
	
		
		
			
		
	
	
			43 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Swift
		
	
| 
								 
											7 years ago
										 
									 | 
							
								//
							 | 
						||
| 
								 | 
							
								//  Copyright (c) 2018 Open Whisper Systems. All rights reserved.
							 | 
						||
| 
								 | 
							
								//
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								import XCTest
							 | 
						||
| 
								 | 
							
								@testable import SignalMessaging
							 | 
						||
| 
								 | 
							
								@testable import SignalServiceKit
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								class MantlePerfTest: SignalBaseTest {
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    var primaryStorage: OWSPrimaryStorage {
							 | 
						||
| 
								 | 
							
								        return SSKEnvironment.shared.primaryStorage
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    override func setUp() {
							 | 
						||
| 
								 | 
							
								        // Put setup code here. This method is called before the invocation of each test method in the class.
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    override func tearDown() {
							 | 
						||
| 
								 | 
							
								        // Put teardown code here. This method is called after the invocation of each test method in the class.
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    func testPerformanceExample() {
							 | 
						||
| 
								 | 
							
								        let migration = OWS110SortIdMigration()
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        self.measureMetrics(XCTestCase.defaultPerformanceMetrics, automaticallyStartMeasuring: false) {
							 | 
						||
| 
								 | 
							
								            _ = OutgoingMessageFactory().create(count: 100)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								            startMeasuring()
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								            let migrationCompleted = expectation(description: "migrationCompleted")
							 | 
						||
| 
								 | 
							
								            migration.runUp(completion: migrationCompleted.fulfill)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								            self.wait(for: [migrationCompleted], timeout: 10)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								            stopMeasuring()
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								            TSInteraction.removeAllObjectsInCollection()
							 | 
						||
| 
								 | 
							
								        }
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								}
							 |