├── README.md
├── Benchmark
├── Resources
│ └── Assets.xcassets
│ │ ├── Contents.json
│ │ ├── AppIcon.appiconset
│ │ ├── 128 batt.png
│ │ ├── 16 batt.png
│ │ ├── 1024 batt.png
│ │ ├── 32 batt@0.25x.png
│ │ ├── 512 batt@0.5x.png
│ │ ├── 64 batt@0.5x.png
│ │ ├── 256 batt@0.25x-1.png
│ │ ├── 256 batt@0.25x.png
│ │ ├── 32 batt@0.25x-1.png
│ │ ├── 512 batt@0.5x-1.png
│ │ └── Contents.json
│ │ ├── trash_icon.imageset
│ │ ├── trash_icon.pdf
│ │ └── Contents.json
│ │ ├── folder_icon.imageset
│ │ ├── folder_icon.pdf
│ │ └── Contents.json
│ │ ├── drive_icon.imageset
│ │ ├── Contents.json
│ │ └── drive_icon.pdf
│ │ └── battery_icon.imageset
│ │ ├── Contents.json
│ │ └── battery_icon.pdf
├── Modules
│ ├── Battery
│ │ ├── Benchmark-Bridging-Header.h
│ │ ├── KABattery.h
│ │ ├── KABattery.m
│ │ └── BatteryViewController.swift
│ └── SSD
│ │ ├── SSDRouter.swift
│ │ ├── SSDConfigurator.swift
│ │ ├── SSDProtocols.swift
│ │ ├── SSDInteractor.swift
│ │ ├── SSD Graph
│ │ └── SSDGraphViewController.swift
│ │ ├── SSDPresenter.swift
│ │ └── SSDViewController.swift
├── Benchmark.entitlements
├── App Delegate
│ └── AppDelegate.swift
├── Services
│ ├── StorageInfoService.swift
│ ├── BlockWriteOperation.swift
│ └── LoggerService.swift
├── Info.plist
└── Storyboards
│ └── Base.lproj
│ └── Main.storyboard
├── BenchmarkTests
├── Info.plist
└── BenchmarkTests.swift
├── .gitignore
└── Benchmark.xcodeproj
└── project.pbxproj
/README.md:
--------------------------------------------------------------------------------
1 | # bench
2 | small ssd bench
3 |
--------------------------------------------------------------------------------
/Benchmark/Resources/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/Benchmark/Resources/Assets.xcassets/AppIcon.appiconset/128 batt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavars/bench/HEAD/Benchmark/Resources/Assets.xcassets/AppIcon.appiconset/128 batt.png
--------------------------------------------------------------------------------
/Benchmark/Resources/Assets.xcassets/AppIcon.appiconset/16 batt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavars/bench/HEAD/Benchmark/Resources/Assets.xcassets/AppIcon.appiconset/16 batt.png
--------------------------------------------------------------------------------
/Benchmark/Resources/Assets.xcassets/AppIcon.appiconset/1024 batt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavars/bench/HEAD/Benchmark/Resources/Assets.xcassets/AppIcon.appiconset/1024 batt.png
--------------------------------------------------------------------------------
/Benchmark/Resources/Assets.xcassets/trash_icon.imageset/trash_icon.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavars/bench/HEAD/Benchmark/Resources/Assets.xcassets/trash_icon.imageset/trash_icon.pdf
--------------------------------------------------------------------------------
/Benchmark/Resources/Assets.xcassets/AppIcon.appiconset/32 batt@0.25x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavars/bench/HEAD/Benchmark/Resources/Assets.xcassets/AppIcon.appiconset/32 batt@0.25x.png
--------------------------------------------------------------------------------
/Benchmark/Resources/Assets.xcassets/AppIcon.appiconset/512 batt@0.5x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavars/bench/HEAD/Benchmark/Resources/Assets.xcassets/AppIcon.appiconset/512 batt@0.5x.png
--------------------------------------------------------------------------------
/Benchmark/Resources/Assets.xcassets/AppIcon.appiconset/64 batt@0.5x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavars/bench/HEAD/Benchmark/Resources/Assets.xcassets/AppIcon.appiconset/64 batt@0.5x.png
--------------------------------------------------------------------------------
/Benchmark/Resources/Assets.xcassets/folder_icon.imageset/folder_icon.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavars/bench/HEAD/Benchmark/Resources/Assets.xcassets/folder_icon.imageset/folder_icon.pdf
--------------------------------------------------------------------------------
/Benchmark/Resources/Assets.xcassets/AppIcon.appiconset/256 batt@0.25x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavars/bench/HEAD/Benchmark/Resources/Assets.xcassets/AppIcon.appiconset/256 batt@0.25x-1.png
--------------------------------------------------------------------------------
/Benchmark/Resources/Assets.xcassets/AppIcon.appiconset/256 batt@0.25x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavars/bench/HEAD/Benchmark/Resources/Assets.xcassets/AppIcon.appiconset/256 batt@0.25x.png
--------------------------------------------------------------------------------
/Benchmark/Resources/Assets.xcassets/AppIcon.appiconset/32 batt@0.25x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavars/bench/HEAD/Benchmark/Resources/Assets.xcassets/AppIcon.appiconset/32 batt@0.25x-1.png
--------------------------------------------------------------------------------
/Benchmark/Resources/Assets.xcassets/AppIcon.appiconset/512 batt@0.5x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavars/bench/HEAD/Benchmark/Resources/Assets.xcassets/AppIcon.appiconset/512 batt@0.5x-1.png
--------------------------------------------------------------------------------
/Benchmark/Modules/Battery/Benchmark-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | //
2 | // Use this file to import your target's public headers that you would like to expose to Swift.
3 | //
4 |
5 | #import "KABattery.h"
6 |
--------------------------------------------------------------------------------
/Benchmark/Benchmark.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.files.user-selected.read-write
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Benchmark/Resources/Assets.xcassets/drive_icon.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "drive_icon.pdf",
5 | "idiom" : "universal"
6 | }
7 | ],
8 | "info" : {
9 | "author" : "xcode",
10 | "version" : 1
11 | },
12 | "properties" : {
13 | "preserves-vector-representation" : true,
14 | "template-rendering-intent" : "template"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Benchmark/Resources/Assets.xcassets/folder_icon.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "folder_icon.pdf",
5 | "idiom" : "universal"
6 | }
7 | ],
8 | "info" : {
9 | "author" : "xcode",
10 | "version" : 1
11 | },
12 | "properties" : {
13 | "preserves-vector-representation" : true,
14 | "template-rendering-intent" : "template"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Benchmark/Resources/Assets.xcassets/trash_icon.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "trash_icon.pdf",
5 | "idiom" : "universal"
6 | }
7 | ],
8 | "info" : {
9 | "author" : "xcode",
10 | "version" : 1
11 | },
12 | "properties" : {
13 | "preserves-vector-representation" : true,
14 | "template-rendering-intent" : "template"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Benchmark/Resources/Assets.xcassets/battery_icon.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "battery_icon.pdf",
5 | "idiom" : "universal"
6 | }
7 | ],
8 | "info" : {
9 | "author" : "xcode",
10 | "version" : 1
11 | },
12 | "properties" : {
13 | "preserves-vector-representation" : true,
14 | "template-rendering-intent" : "template"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Benchmark/Modules/SSD/SSDRouter.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SSDRouter.swift
3 | // Benchmark
4 | //
5 | // Created by Kirill Varshamov on 23.08.2020.
6 | // Copyright © 2020 Kirill Varshamov. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | class SSDRouter: SSDRouterProtocol {
12 | // MARK: - Properties
13 | weak var viewController: SSDViewController!
14 |
15 | // MARK: - Initializers
16 | init(viewController: SSDViewController) {
17 | self.viewController = viewController
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Benchmark/Modules/Battery/KABattery.h:
--------------------------------------------------------------------------------
1 | //
2 | // KABattery.h
3 | // Benchmark
4 | //
5 | // Created by Kirill Varshamov on 30.11.2020.
6 | // Copyright © 2020 Kirill Varshamov. All rights reserved.
7 | //
8 |
9 | #ifndef KABattery_h
10 | #define KABattery_h
11 |
12 | #import
13 |
14 | @interface KABattery : NSObject
15 |
16 | @property NSNumber *temperature;
17 | @property NSNumber *currentCapacity;
18 | @property NSNumber *designCapacity;
19 | @property NSNumber *maximumCapacity;
20 |
21 | +(KABattery*) updateBatteryStatus;
22 |
23 | @end
24 |
25 | #endif /* KABattery_h */
26 |
--------------------------------------------------------------------------------
/Benchmark/App Delegate/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // Benchmark
4 | //
5 | // Created by Kirill Varshamov on 23.08.2020.
6 | // Copyright © 2020 Kirill Varshamov. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | @NSApplicationMain
12 | class AppDelegate: NSObject, NSApplicationDelegate {
13 |
14 |
15 |
16 | func applicationDidFinishLaunching(_ aNotification: Notification) {
17 | // Insert code here to initialize your application
18 | }
19 |
20 | func applicationWillTerminate(_ aNotification: Notification) {
21 | // Insert code here to tear down your application
22 | }
23 |
24 |
25 | }
26 |
27 |
--------------------------------------------------------------------------------
/Benchmark/Modules/SSD/SSDConfigurator.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SSDConfigurator.swift
3 | // Benchmark
4 | //
5 | // Created by Kirill Varshamov on 23.08.2020.
6 | // Copyright © 2020 Kirill Varshamov. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | class SSDConfigurator: SSDConfiguratorProtocol {
12 | func configure(with viewController: SSDViewController) {
13 | let presenter = SSDPresenter(view: viewController)
14 | let interactor = SSDInteractor(presenter: presenter)
15 | let router = SSDRouter(viewController: viewController)
16 |
17 | viewController.presenter = presenter
18 | presenter.interactor = interactor
19 | presenter.router = router
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/BenchmarkTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE)
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/BenchmarkTests/BenchmarkTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BenchmarkTests.swift
3 | // BenchmarkTests
4 | //
5 | // Created by Kirill Varshamov on 23.08.2020.
6 | // Copyright © 2020 Kirill Varshamov. All rights reserved.
7 | //
8 |
9 | import XCTest
10 | @testable import Benchmark
11 |
12 | class BenchmarkTests: XCTestCase {
13 |
14 | override func setUpWithError() throws {
15 | // Put setup code here. This method is called before the invocation of each test method in the class.
16 | }
17 |
18 | override func tearDownWithError() throws {
19 | // Put teardown code here. This method is called after the invocation of each test method in the class.
20 | }
21 |
22 | func testExample() throws {
23 | // This is an example of a functional test case.
24 | // Use XCTAssert and related functions to verify your tests produce the correct results.
25 | }
26 |
27 | func testPerformanceExample() throws {
28 | // This is an example of a performance test case.
29 | let data = Data(count: 4*1000*1000*1000)
30 |
31 |
32 | self.measure {
33 | do {
34 | try data.write(to: FileManager.default.homeDirectoryForCurrentUser.appendingPathComponent("test.data"))
35 | } catch let error as NSError {
36 | print(error.localizedDescription)
37 | }
38 | }
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/Benchmark/Services/StorageInfoService.swift:
--------------------------------------------------------------------------------
1 | //
2 | // StorageInfoService.swift
3 | // Benchmark
4 | //
5 | // Created by Kirill Varshamov on 23.08.2020.
6 | // Copyright © 2020 Kirill Varshamov. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | class DiskStatus {
12 |
13 | //MARK: Get raw value
14 | class var totalDiskSpaceInBytes:Int64 {
15 | get {
16 | do {
17 | let systemAttributes = try FileManager.default.attributesOfFileSystem(forPath: NSHomeDirectory() as String)
18 | let space = (systemAttributes[FileAttributeKey.systemSize] as? NSNumber)?.int64Value
19 | return space!
20 | } catch {
21 | return 0
22 | }
23 | }
24 | }
25 |
26 | class var freeDiskSpaceInBytes:Int64 {
27 | get {
28 | do {
29 | let systemAttributes = try FileManager.default.attributesOfFileSystem(forPath: NSHomeDirectory() as String)
30 | let freeSpace = (systemAttributes[FileAttributeKey.systemFreeSize] as? NSNumber)?.int64Value
31 | return freeSpace!
32 | } catch {
33 | return 0
34 | }
35 | }
36 | }
37 |
38 | class var usedDiskSpaceInBytes:Int64 {
39 | get {
40 | let usedSpace = totalDiskSpaceInBytes - freeDiskSpaceInBytes
41 | return usedSpace
42 | }
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/Benchmark/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | $(PRODUCT_BUNDLE_PACKAGE_TYPE)
19 | CFBundleShortVersionString
20 | $(MARKETING_VERSION)
21 | CFBundleVersion
22 | $(CURRENT_PROJECT_VERSION)
23 | LSApplicationCategoryType
24 | public.app-category.utilities
25 | LSMinimumSystemVersion
26 | $(MACOSX_DEPLOYMENT_TARGET)
27 | NSHumanReadableCopyright
28 | Copyright © 2020 Kirill Varshamov. All rights reserved.
29 | NSMainStoryboardFile
30 | Main
31 | NSPrincipalClass
32 | NSApplication
33 | NSSupportsAutomaticTermination
34 |
35 | NSSupportsSuddenTermination
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/Benchmark/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "16 batt.png",
5 | "idiom" : "mac",
6 | "scale" : "1x",
7 | "size" : "16x16"
8 | },
9 | {
10 | "filename" : "32 batt@0.25x-1.png",
11 | "idiom" : "mac",
12 | "scale" : "2x",
13 | "size" : "16x16"
14 | },
15 | {
16 | "filename" : "32 batt@0.25x.png",
17 | "idiom" : "mac",
18 | "scale" : "1x",
19 | "size" : "32x32"
20 | },
21 | {
22 | "filename" : "64 batt@0.5x.png",
23 | "idiom" : "mac",
24 | "scale" : "2x",
25 | "size" : "32x32"
26 | },
27 | {
28 | "filename" : "128 batt.png",
29 | "idiom" : "mac",
30 | "scale" : "1x",
31 | "size" : "128x128"
32 | },
33 | {
34 | "filename" : "256 batt@0.25x-1.png",
35 | "idiom" : "mac",
36 | "scale" : "2x",
37 | "size" : "128x128"
38 | },
39 | {
40 | "filename" : "256 batt@0.25x.png",
41 | "idiom" : "mac",
42 | "scale" : "1x",
43 | "size" : "256x256"
44 | },
45 | {
46 | "filename" : "512 batt@0.5x-1.png",
47 | "idiom" : "mac",
48 | "scale" : "2x",
49 | "size" : "256x256"
50 | },
51 | {
52 | "filename" : "512 batt@0.5x.png",
53 | "idiom" : "mac",
54 | "scale" : "1x",
55 | "size" : "512x512"
56 | },
57 | {
58 | "filename" : "1024 batt.png",
59 | "idiom" : "mac",
60 | "scale" : "2x",
61 | "size" : "512x512"
62 | }
63 | ],
64 | "info" : {
65 | "author" : "xcode",
66 | "version" : 1
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/Benchmark/Services/BlockWriteOperation.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BlockWriteOperation.swift
3 | // Benchmark
4 | //
5 | // Created by Kirill Varshamov on 13.12.2020.
6 | // Copyright © 2020 Kirill Varshamov. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | class BlockWriteOperation: Operation {
12 |
13 | var blockCount: Int32
14 | var uiUpdater: (Int, Int, TimeInterval) -> Void
15 |
16 | init(blockCount: Int32, uiUpdater: @escaping (Int, Int, TimeInterval) -> Void) {
17 | self.blockCount = blockCount
18 | self.uiUpdater = uiUpdater
19 | }
20 |
21 | override func main() {
22 | let dateFormatter = DateFormatter()
23 | dateFormatter.dateFormat = "y-MM-dd H-m-ss.SSSS"
24 |
25 | let gb = 1000 * 1000 * 1000
26 | let data = Data(count: gb)
27 |
28 | let dirPath = FileManager.default.homeDirectoryForCurrentUser.appendingPathComponent("SSDBlocks")
29 |
30 | try? FileManager.default.createDirectory(at: dirPath, withIntermediateDirectories: true, attributes: nil) //
31 |
32 | for i in 0.. Void)
44 | func stopOperation()
45 | func startWrite()
46 |
47 | func moveLogFile(to url: URL)
48 | }
49 |
50 | // MARK: - Presenter protocol
51 | protocol SSDPresenterProtocol: class {
52 | var router: SSDRouterProtocol! { set get }
53 | var currentLogName: String { get }
54 |
55 | func configureView()
56 |
57 | func textFieldUpdated(with newValue: String, maxValue: Double)
58 | func sliderMoved(with newValue: Int32)
59 |
60 | func startButtonTapped()
61 | func stopButtonTapped()
62 |
63 | func stopWrite()
64 |
65 | func updateWhileWrite(at index: Int, with result: Int, _ blockCount: Int32)
66 |
67 | func updateUI()
68 |
69 | func showAlert(with message: String)
70 | func moveLogFile(to url: URL)
71 | }
72 |
73 | // MARK: - Configurator protocol
74 | protocol SSDConfiguratorProtocol: class {
75 | func configure(with viewController: SSDViewController)
76 | }
77 |
78 | // MARK: - Router protocol
79 | protocol SSDRouterProtocol: class {
80 |
81 | }
82 |
--------------------------------------------------------------------------------
/Benchmark/Modules/Battery/KABattery.m:
--------------------------------------------------------------------------------
1 | //
2 | // KABattery.m
3 | // Benchmark
4 | //
5 | // Created by Kirill Varshamov on 30.11.2020.
6 | // Copyright © 2020 Kirill Varshamov. All rights reserved.
7 | //
8 |
9 | #import "KABattery.h"
10 | #import
11 | #import
12 | #import
13 |
14 | @implementation KABattery
15 |
16 | @synthesize temperature, currentCapacity, designCapacity, maximumCapacity;
17 |
18 | -(instancetype) initWithTemperature: (NSNumber *) temperature WithCurrentCapacity: (NSNumber *) currentCapacity WithDesignCapacity: (NSNumber *) designCapacity andWithMaximumCapacity: (NSNumber *) maximumCapacity {
19 | self = [super init];
20 |
21 | if (self) {
22 | self.temperature = temperature;
23 | self.currentCapacity = currentCapacity;
24 | self.designCapacity = designCapacity;
25 | self.maximumCapacity = maximumCapacity;
26 | }
27 |
28 | return self;
29 | }
30 |
31 | + (KABattery*)updateBatteryStatus {
32 |
33 | CFMutableDictionaryRef ioServices, cfBatteryDict = NULL;
34 | io_registry_entry_t entry = 0;
35 | ioServices = IOServiceNameMatching("AppleSmartBattery");
36 | entry = IOServiceGetMatchingService(kIOMasterPortDefault, ioServices);
37 |
38 | IORegistryEntryCreateCFProperties(entry, &cfBatteryDict, NULL, 0);
39 | NSDictionary *batteryDict = (__bridge NSDictionary *)cfBatteryDict;
40 |
41 | // Temperature
42 | float battTemp = [[batteryDict objectForKey:@"Temperature"] floatValue];
43 | NSNumber *temp = [[NSNumber alloc] initWithFloat: battTemp / 100];
44 |
45 | // Current Capacity
46 | NSInteger battCurrCap = [[batteryDict objectForKey:@"CurrentCapacity"] integerValue];
47 | NSNumber *currentCap = [[NSNumber alloc] initWithLong: battCurrCap];
48 |
49 | // Design Capacity
50 | NSInteger battDesCap = [[batteryDict objectForKey:@"DesignCapacity"] integerValue];
51 | NSNumber *designCap = [[NSNumber alloc] initWithLong: battDesCap];
52 |
53 | // Full Charge Capacity
54 | NSInteger battMaxCap = [[batteryDict objectForKey:@"MaxCapacity"] integerValue];
55 | NSNumber *maximumCap = [[NSNumber alloc] initWithLong: battMaxCap];
56 |
57 | KABattery *batteryData = [[KABattery alloc] initWithTemperature: temp WithCurrentCapacity: currentCap WithDesignCapacity: designCap andWithMaximumCapacity: maximumCap];
58 |
59 | return batteryData;
60 | }
61 |
62 | @end
63 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4 |
5 | ## User settings
6 | xcuserdata/
7 |
8 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
9 | *.xcscmblueprint
10 | *.xccheckout
11 |
12 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
13 | build/
14 | DerivedData/
15 | *.moved-aside
16 | *.pbxuser
17 | !default.pbxuser
18 | *.mode1v3
19 | !default.mode1v3
20 | *.mode2v3
21 | !default.mode2v3
22 | *.perspectivev3
23 | !default.perspectivev3
24 |
25 | ## Obj-C/Swift specific
26 | *.hmap
27 |
28 | ## App packaging
29 | *.ipa
30 | *.dSYM.zip
31 | *.dSYM
32 |
33 | ## Playgrounds
34 | timeline.xctimeline
35 | playground.xcworkspace
36 |
37 | # Swift Package Manager
38 | #
39 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
40 | # Packages/
41 | # Package.pins
42 | # Package.resolved
43 | # *.xcodeproj
44 | #
45 | # Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
46 | # hence it is not needed unless you have added a package configuration file to your project
47 | # .swiftpm
48 |
49 | .build/
50 |
51 | # CocoaPods
52 | #
53 | # We recommend against adding the Pods directory to your .gitignore. However
54 | # you should judge for yourself, the pros and cons are mentioned at:
55 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
56 | #
57 | # Pods/
58 | #
59 | # Add this line if you want to avoid checking in source code from the Xcode workspace
60 | # *.xcworkspace
61 |
62 | # Carthage
63 | #
64 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
65 | # Carthage/Checkouts
66 |
67 | Carthage/Build/
68 |
69 | # Accio dependency management
70 | Dependencies/
71 | .accio/
72 |
73 | # fastlane
74 | #
75 | # It is recommended to not store the screenshots in the git repo.
76 | # Instead, use fastlane to re-generate the screenshots whenever they are needed.
77 | # For more information about the recommended setup visit:
78 | # https://docs.fastlane.tools/best-practices/source-control/#source-control
79 |
80 | fastlane/report.xml
81 | fastlane/Preview.html
82 | fastlane/screenshots/**/*.png
83 | fastlane/test_output
84 |
85 | # Code Injection
86 | #
87 | # After new code Injection tools there's a generated folder /iOSInjectionProject
88 | # https://github.com/johnno1962/injectionforxcode
89 |
90 | iOSInjectionProject/
91 |
--------------------------------------------------------------------------------
/Benchmark/Modules/SSD/SSDInteractor.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SSDInteractor.swift
3 | // Benchmark
4 | //
5 | // Created by Kirill Varshamov on 23.08.2020.
6 | // Copyright © 2020 Kirill Varshamov. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | class SSDInteractor: SSDInteractorProtocol {
12 | // MARK: - Properties
13 | weak var presenter: SSDPresenterProtocol!
14 | let opQueue = OperationQueue()
15 |
16 | var blockCount: Int32 = 1
17 |
18 | lazy var logger: SSDLogService = LoggerService()
19 |
20 | var currentLogName: String {
21 | return logger.logFileName
22 | }
23 |
24 | var totalSpaceInByte: Int64 {
25 | get {
26 | return DiskStatus.totalDiskSpaceInBytes
27 | }
28 | }
29 |
30 | var usedSpaceInByte: Int64 {
31 | get {
32 | return DiskStatus.usedDiskSpaceInBytes
33 | }
34 | }
35 |
36 | var freeSpaceInByte: Int64 {
37 | get {
38 | return DiskStatus.freeDiskSpaceInBytes
39 | }
40 | }
41 |
42 | // MARK: - Initializers
43 | init(presenter: SSDPresenterProtocol) {
44 | self.presenter = presenter
45 |
46 | opQueue.qualityOfService = .userInteractive
47 | }
48 |
49 | // MARK: - SSDInteractor methods
50 |
51 | func createLogFileForSSD(failure: @escaping (String) -> Void) {
52 | logger.createLogFileForSSD(failure: failure)
53 | }
54 |
55 | func stopOperation() {
56 | opQueue.cancelAllOperations()
57 | }
58 |
59 | func startWrite() {
60 | let blockWriteOperation = BlockWriteOperation(blockCount: blockCount) { (index, result, blockTime) in
61 |
62 | self.logger.writeSSDLog(index: Int(index) + 1, speed: result, time: blockTime)
63 |
64 | self.presenter.updateWhileWrite(at: index, with: result, self.blockCount)
65 | }
66 |
67 | blockWriteOperation.completionBlock = {
68 | if !blockWriteOperation.isCancelled {
69 | // move delay to view layer
70 | DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
71 | self.presenter.stopWrite()
72 | }
73 | }
74 | self.presenter.updateUI()
75 |
76 | }
77 |
78 | opQueue.addOperation(blockWriteOperation)
79 | }
80 |
81 | func moveLogFile(to url: URL) {
82 | if let dir = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first {
83 |
84 | let fileURL = dir.appendingPathComponent(logger.logFileName)
85 |
86 | do {
87 | _ = try FileManager.default.replaceItemAt(url, withItemAt: fileURL)
88 | } catch {
89 | presenter.showAlert(with: error.localizedDescription + "\n\nYou can find log at ~/Library/Containers/Benchmark/data/Documents/")
90 | }
91 | }
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/Benchmark/Modules/SSD/SSD Graph/SSDGraphViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SSDGraphViewController.swift
3 | // Benchmark
4 | //
5 | // Created by Kirill Varshamov on 05.01.2021.
6 | // Copyright © 2021 Kirill Varshamov. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | class SSDGraphViewController: NSViewController {
12 |
13 | let graphStack: NSStackView = {
14 | let stackView = NSStackView()
15 |
16 | stackView.spacing = 3
17 | stackView.alignment = .bottom
18 | stackView.distribution = .fill
19 | stackView.orientation = .horizontal
20 |
21 | stackView.translatesAutoresizingMaskIntoConstraints = false
22 | return stackView
23 | }()
24 |
25 | override func loadView() {
26 | self.view = NSView()
27 | }
28 |
29 | override func viewDidLoad() {
30 | super.viewDidLoad()
31 |
32 | view.addSubview(graphStack)
33 |
34 | NSLayoutConstraint.activate([
35 | graphStack.topAnchor.constraint(equalTo: view.topAnchor, constant: 16),
36 | graphStack.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 16),
37 | graphStack.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -16),
38 | graphStack.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: -16)
39 | ])
40 | }
41 |
42 | func buildGraph(with csvFile: String) {
43 | // print(csvFile)
44 |
45 | let testData = [
46 | 0.85,
47 | 0.9,
48 | 0.5,
49 | 0.1,
50 | 0.85,
51 | 0.9,
52 | 0.5,
53 | 0.1,
54 | 0.85,
55 | 0.9,
56 | 0.5,
57 | 0.1,
58 | 0.2
59 | ]
60 |
61 | for data in testData {
62 | let gView = NSView()
63 | gView.translatesAutoresizingMaskIntoConstraints = false
64 | gView.wantsLayer = true
65 | gView.layer?.backgroundColor = NSColor.systemGreen.cgColor
66 | gView.layer?.cornerRadius = 3
67 |
68 | let widthSize = CGFloat((150 - 16 - 16 - 3 * (testData.count - 1)) / testData.count)
69 |
70 | print(widthSize) // normal width size = 6
71 |
72 | let heightSize = CGFloat((150 - 16 - 16) * data)
73 |
74 | let height = gView.heightAnchor.constraint(equalToConstant: 0)
75 |
76 | NSLayoutConstraint.activate([
77 | gView.widthAnchor.constraint(equalToConstant: widthSize),
78 | height
79 | ])
80 |
81 | graphStack.addArrangedSubview(gView)
82 | NSAnimationContext.runAnimationGroup { (context) in
83 | context.duration = 1.0
84 | height.animator().constant = heightSize
85 | }
86 |
87 | }
88 |
89 | NSAnimationContext.runAnimationGroup { (context) in
90 | context.duration = 2.0
91 | } completionHandler: {
92 | // button.alphaValue = 1.0
93 | }
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/Benchmark/Resources/Assets.xcassets/battery_icon.imageset/battery_icon.pdf:
--------------------------------------------------------------------------------
1 | %PDF-1.7
2 |
3 | 1 0 obj
4 | << >>
5 | endobj
6 |
7 | 2 0 obj
8 | << /Length 3 0 R >>
9 | stream
10 | /DeviceRGB CS
11 | /DeviceRGB cs
12 | q
13 | 1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 cm
14 | 0.000000 0.000000 0.000000 scn
15 | 26.025408 -0.000008 m
16 | 104.003822 -0.000008 l
17 | 112.304825 -0.000008 119.335831 0.781242 124.316833 5.761715 c
18 | 129.296829 10.742168 130.028824 17.724575 130.028824 26.074284 c
19 | 130.028824 42.578201 l
20 | 130.028824 50.878906 129.296829 57.861412 124.316833 62.841816 c
21 | 119.335831 67.822319 112.304825 68.603516 104.003822 68.603516 c
22 | 25.927706 68.603516 l
23 | 17.724604 68.603516 10.693304 67.822319 5.712903 62.793015 c
24 | 0.732401 57.812508 0.000000 50.878906 0.000000 42.675797 c
25 | 0.000000 26.074284 l
26 | 0.000000 17.724575 0.732401 10.742168 5.712903 5.761715 c
27 | 10.693304 0.781242 17.724606 -0.000008 26.025408 -0.000008 c
28 | h
29 | 24.707006 7.861328 m
30 | 19.677706 7.861328 14.404305 8.544926 11.425804 11.523472 c
31 | 8.496103 14.453171 7.861302 19.677776 7.861302 24.707081 c
32 | 7.861302 43.750000 l
33 | 7.861302 48.925804 8.496103 54.150406 11.425804 57.128906 c
34 | 14.404305 60.058609 19.726505 60.742210 24.853506 60.742210 c
35 | 105.321823 60.742210 l
36 | 110.351830 60.742210 115.624817 60.058613 118.603821 57.080109 c
37 | 121.532822 54.150406 122.167831 48.925804 122.167831 43.896500 c
38 | 122.167831 24.707081 l
39 | 122.167831 19.677776 121.532822 14.453171 118.603821 11.523472 c
40 | 115.624817 8.544926 110.351830 7.861328 105.321823 7.861328 c
41 | 24.707006 7.861328 l
42 | h
43 | 22.753908 14.062473 m
44 | 107.323822 14.062473 l
45 | 110.741829 14.062473 112.646820 14.453175 114.110825 15.917973 c
46 | 115.575821 17.382774 116.015823 19.287075 116.015823 22.705078 c
47 | 116.015823 45.898499 l
48 | 116.015823 49.316402 115.527824 51.220703 114.110825 52.685608 c
49 | 112.646820 54.150406 110.741829 54.541107 107.323822 54.541107 c
50 | 22.753908 54.541107 l
51 | 19.335907 54.541107 17.431604 54.150406 15.966804 52.685608 c
52 | 14.550803 51.220703 14.062505 49.316402 14.062505 45.898499 c
53 | 14.062505 22.705078 l
54 | 14.062505 19.287075 14.550803 17.382774 15.966804 15.917973 c
55 | 17.431604 14.453175 19.335907 14.062473 22.753908 14.062473 c
56 | h
57 | 136.669830 21.679680 m
58 | 140.575836 21.923878 145.751831 26.855484 145.751831 34.326191 c
59 | 145.751831 41.748093 140.575836 46.679703 136.669830 46.923904 c
60 | 136.669830 21.679680 l
61 | h
62 | f
63 | n
64 | Q
65 |
66 | endstream
67 | endobj
68 |
69 | 3 0 obj
70 | 2144
71 | endobj
72 |
73 | 4 0 obj
74 | << /Annots []
75 | /Type /Page
76 | /MediaBox [ 0.000000 0.000000 145.751831 68.603516 ]
77 | /Resources 1 0 R
78 | /Contents 2 0 R
79 | /Parent 5 0 R
80 | >>
81 | endobj
82 |
83 | 5 0 obj
84 | << /Kids [ 4 0 R ]
85 | /Count 1
86 | /Type /Pages
87 | >>
88 | endobj
89 |
90 | 6 0 obj
91 | << /Type /Catalog
92 | /Pages 5 0 R
93 | >>
94 | endobj
95 |
96 | xref
97 | 0 7
98 | 0000000000 65535 f
99 | 0000000010 00000 n
100 | 0000000034 00000 n
101 | 0000002234 00000 n
102 | 0000002257 00000 n
103 | 0000002431 00000 n
104 | 0000002505 00000 n
105 | trailer
106 | << /ID [ (some) (id) ]
107 | /Root 6 0 R
108 | /Size 7
109 | >>
110 | startxref
111 | 2564
112 | %%EOF
--------------------------------------------------------------------------------
/Benchmark/Modules/Battery/BatteryViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BatteryViewController.swift
3 | // Benchmark
4 | //
5 | // Created by Kirill Varshamov on 01.12.2020.
6 | // Copyright © 2020 Kirill Varshamov. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | class BatteryViewController: NSViewController {
12 |
13 | var logger: BatteryLogService = LoggerService()
14 |
15 | var timer: Timer?
16 | var labelTimer: Timer?
17 | var startTime = Date()
18 |
19 | let dateFormatter: DateFormatter = {
20 | let dateFormatter = DateFormatter()
21 | dateFormatter.locale = .init(identifier: "en_US")
22 | dateFormatter.dateFormat = "HH:mm:ss"
23 | dateFormatter.timeZone = TimeZone(secondsFromGMT: 0)
24 |
25 | return dateFormatter
26 | }()
27 |
28 | @IBOutlet weak var startButton: NSButton!
29 | @IBOutlet weak var stopButton: NSButton!
30 | @IBOutlet weak var timeLabel: NSTextField!
31 |
32 | override func viewDidLoad() {
33 | super.viewDidLoad()
34 |
35 | stopButton.isEnabled = false
36 | timeLabel.stringValue = "00:00:00"
37 | }
38 |
39 | @objc func startCollectionBatteryStats() {
40 | DispatchQueue.main.async {
41 | self.timeLabel.stringValue = "00:00:00"
42 | self.startButton.isEnabled = false
43 | self.stopButton.isEnabled = true
44 | }
45 |
46 | logger.createLogFileForBattery { (error) in
47 | // error alert
48 | }
49 |
50 | startTime = Date()
51 |
52 | timer = Timer.scheduledTimer(timeInterval: 10.0, target: self, selector: #selector(getBatt), userInfo: nil, repeats: true)
53 | labelTimer = Timer.scheduledTimer(timeInterval: 1.0, target: self, selector: #selector(updateTimeLabel), userInfo: nil, repeats: true)
54 |
55 | updateTimeLabel()
56 | }
57 |
58 | @objc func getBatt() {
59 | DispatchQueue.global(qos: .utility).async {
60 | guard let data = KABattery.updateStatus(),
61 | let temp = data.temperature,
62 | let currentCap = data.currentCapacity,
63 | let designCap = data.designCapacity,
64 | let maxCap = data.maximumCapacity
65 | else {
66 | return
67 | }
68 |
69 | self.logger.writeBatteryLog(temp: temp, currentCap: currentCap, maxCap: maxCap, designCap: designCap)
70 | }
71 | }
72 |
73 | @objc func updateTimeLabel() {
74 | DispatchQueue.main.async {
75 |
76 | guard let labelTimer = self.labelTimer else {
77 | self.timeLabel.stringValue = "The timer is broken"
78 | return
79 | }
80 |
81 | let time = Date(timeIntervalSince1970: -self.startTime.timeIntervalSince(labelTimer.fireDate))
82 | self.timeLabel.stringValue = self.dateFormatter.string(from: time)
83 | }
84 | }
85 |
86 | @IBAction func openLogFolder(_ sender: NSButton) {
87 | if let dir = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first {
88 | NSWorkspace.shared.open(dir)
89 | }
90 | }
91 |
92 | @IBAction func startCollectionBatteryStats(_ sender: NSButton) {
93 | startCollectionBatteryStats()
94 | }
95 |
96 | @IBAction func stopCollectionBatteryStats(_ sender: NSButton) {
97 | stopButton.isEnabled = false
98 | startButton.isEnabled = true
99 |
100 | timer?.invalidate()
101 | timer = nil
102 |
103 | labelTimer?.invalidate()
104 | labelTimer = nil
105 | }
106 | }
107 |
--------------------------------------------------------------------------------
/Benchmark/Resources/Assets.xcassets/drive_icon.imageset/drive_icon.pdf:
--------------------------------------------------------------------------------
1 | %PDF-1.7
2 |
3 | 1 0 obj
4 | << >>
5 | endobj
6 |
7 | 2 0 obj
8 | << /Length 3 0 R >>
9 | stream
10 | /DeviceRGB CS
11 | /DeviceRGB cs
12 | q
13 | 1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 cm
14 | 0.000000 0.000000 0.000000 scn
15 | 0.000000 22.021439 m
16 | 0.000000 9.619141 9.619102 0.000000 23.193302 0.000000 c
17 | 92.089798 0.000000 l
18 | 105.663795 0.000000 115.282799 9.619141 115.282799 22.021439 c
19 | 115.282799 25.683640 114.208794 28.955044 112.939796 32.031242 c
20 | 96.484795 71.533241 l
21 | 93.261795 79.345741 86.621101 83.349640 77.880798 83.349640 c
22 | 37.402302 83.349640 l
23 | 28.662102 83.349640 22.021502 79.345741 18.798801 71.533241 c
24 | 2.294901 32.031242 l
25 | 1.074201 29.003944 0.000000 25.683640 0.000000 22.021439 c
26 | h
27 | 15.771501 42.773441 m
28 | 26.416000 69.531242 l
29 | 28.271500 74.169945 32.275398 76.513641 37.792900 76.513641 c
30 | 77.490196 76.513641 l
31 | 83.007797 76.513641 87.060501 74.169945 88.866798 69.531242 c
32 | 99.511795 42.773441 l
33 | 97.216797 43.603542 94.775795 44.042942 92.089798 44.042942 c
34 | 23.193302 44.042942 l
35 | 20.507803 44.042942 18.017601 43.603542 15.771501 42.773441 c
36 | h
37 | 7.861300 22.021439 m
38 | 7.861300 30.078140 13.964802 36.181641 23.193302 36.181641 c
39 | 92.089798 36.181641 l
40 | 101.318802 36.181641 107.421799 30.078140 107.421799 22.021439 c
41 | 107.421799 12.988281 101.318802 7.861328 92.089798 7.861328 c
42 | 23.193302 7.861328 l
43 | 13.964802 7.861328 7.861300 13.964836 7.861300 22.021439 c
44 | h
45 | 43.701103 16.992142 m
46 | 43.701103 15.478523 44.873001 14.257812 46.435501 14.257812 c
47 | 47.949200 14.257812 49.121101 15.478523 49.121101 16.992142 c
48 | 49.121101 27.099640 l
49 | 49.121101 28.564442 47.949200 29.785141 46.435501 29.785141 c
50 | 44.873001 29.785141 43.701103 28.564442 43.701103 27.099640 c
51 | 43.701103 16.992142 l
52 | h
53 | 54.931599 16.992142 m
54 | 54.931599 15.478523 56.103504 14.257812 57.666004 14.257812 c
55 | 59.179703 14.257812 60.351498 15.478523 60.351498 16.992142 c
56 | 60.351498 27.099640 l
57 | 60.351498 28.564442 59.179703 29.785141 57.666004 29.785141 c
58 | 56.103504 29.785141 54.931599 28.564442 54.931599 27.099640 c
59 | 54.931599 16.992142 l
60 | h
61 | 66.113297 16.992142 m
62 | 66.113297 15.478523 67.334000 14.257812 68.896500 14.257812 c
63 | 70.361298 14.257812 71.582001 15.478523 71.582001 16.992142 c
64 | 71.582001 27.099640 l
65 | 71.582001 28.564442 70.361298 29.785141 68.896500 29.785141 c
66 | 67.334000 29.785141 66.113297 28.564442 66.113297 27.099640 c
67 | 66.113297 16.992142 l
68 | h
69 | 77.343697 16.992142 m
70 | 77.343697 15.478523 78.564392 14.257812 80.078094 14.257812 c
71 | 81.591797 14.257812 82.812500 15.478523 82.812500 16.992142 c
72 | 82.812500 27.099640 l
73 | 82.812500 28.564442 81.591797 29.785141 80.078094 29.785141 c
74 | 78.564392 29.785141 77.343697 28.564442 77.343697 27.099640 c
75 | 77.343697 16.992142 l
76 | h
77 | 88.573799 16.992142 m
78 | 88.573799 15.478523 89.745796 14.257812 91.308800 14.257812 c
79 | 92.821800 14.257812 93.993797 15.478523 93.993797 16.992142 c
80 | 93.993797 27.099640 l
81 | 93.993797 28.564442 92.821800 29.785141 91.308800 29.785141 c
82 | 89.745796 29.785141 88.573799 28.564442 88.573799 27.099640 c
83 | 88.573799 16.992142 l
84 | h
85 | f
86 | n
87 | Q
88 |
89 | endstream
90 | endobj
91 |
92 | 3 0 obj
93 | 2855
94 | endobj
95 |
96 | 4 0 obj
97 | << /Annots []
98 | /Type /Page
99 | /MediaBox [ 0.000000 0.000000 115.282776 83.349640 ]
100 | /Resources 1 0 R
101 | /Contents 2 0 R
102 | /Parent 5 0 R
103 | >>
104 | endobj
105 |
106 | 5 0 obj
107 | << /Kids [ 4 0 R ]
108 | /Count 1
109 | /Type /Pages
110 | >>
111 | endobj
112 |
113 | 6 0 obj
114 | << /Type /Catalog
115 | /Pages 5 0 R
116 | >>
117 | endobj
118 |
119 | xref
120 | 0 7
121 | 0000000000 65535 f
122 | 0000000010 00000 n
123 | 0000000034 00000 n
124 | 0000002945 00000 n
125 | 0000002968 00000 n
126 | 0000003142 00000 n
127 | 0000003216 00000 n
128 | trailer
129 | << /ID [ (some) (id) ]
130 | /Root 6 0 R
131 | /Size 7
132 | >>
133 | startxref
134 | 3275
135 | %%EOF
--------------------------------------------------------------------------------
/Benchmark/Modules/SSD/SSDPresenter.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SSDPresenter.swift
3 | // Benchmark
4 | //
5 | // Created by Kirill Varshamov on 23.08.2020.
6 | // Copyright © 2020 Kirill Varshamov. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | class SSDPresenter: SSDPresenterProtocol {
12 |
13 | // MARK: - Properties
14 | weak var view: SSDViewProtocol!
15 | var interactor: SSDInteractorProtocol!
16 | var router: SSDRouterProtocol!
17 |
18 | var currentLogName: String {
19 | return interactor.currentLogName
20 | }
21 |
22 | // MARK: - Initializers
23 | init(view: SSDViewProtocol) {
24 | self.view = view
25 | }
26 |
27 | // MARK: - Configure view
28 | func configureView() {
29 | view.setupButtons()
30 | let freeSpace = Double(interactor.freeSpaceInByte / 1000000000) - 1.0
31 |
32 | view.setupSlider(freeSpaceInBytes: freeSpace)
33 | view.resetUI()
34 | view.setupInputTextField()
35 |
36 | view.setupDiskSpaceLabels(
37 | all: spaceFormatter(bytes: interactor.totalSpaceInByte),
38 | used: spaceFormatter(bytes: interactor.usedSpaceInByte),
39 | free: spaceFormatter(bytes: interactor.freeSpaceInByte)
40 | )
41 |
42 | view.checkBlocksFolder()
43 | }
44 |
45 | // MARK: - SSDPresenterProtocol methods
46 |
47 | func textFieldUpdated(with newValue: String, maxValue: Double) {
48 |
49 | guard let newIntValue = Int32(newValue), newIntValue <= Int32(maxValue), newIntValue > 0 else {
50 | view.createAndShowErrorAlert(with: "Input block size must be more than 0 or less than free space - 1 GB")
51 | return
52 | }
53 |
54 | // let newLabelValue = "\(newIntValue) GB"
55 | let newSliderValue = newIntValue
56 |
57 | // view.updateSliderTextValue(with: newLabelValue)
58 | view.updateSliderValue(with: newSliderValue)
59 | interactor.blockCount = newIntValue
60 | }
61 |
62 | func sliderMoved(with newValue: Int32) {
63 | view.updateSliderTextValue(with: "\(newValue) GB")
64 | interactor.blockCount = newValue
65 | }
66 |
67 | func startButtonTapped() {
68 | view.changeUIForStart(blockCount: interactor.blockCount)
69 |
70 | interactor.createLogFileForSSD { (error) in
71 | self.view.createAndShowErrorAlert(with: error)
72 |
73 | // delay 0.5 ?
74 | self.view.resetUI()
75 | self.view.endWrite()
76 |
77 | self.interactor.stopOperation()
78 | }
79 |
80 | interactor.startWrite()
81 | }
82 |
83 | func stopButtonTapped() {
84 | interactor.stopOperation()
85 |
86 | view.resetUI()
87 | view.endWrite()
88 | }
89 |
90 | func stopWrite() {
91 | view.resetUI()
92 | view.endWrite()
93 | }
94 |
95 | func updateWhileWrite(at index: Int, with result: Int, _ blockCount: Int32) {
96 | view.updateWriteSpeed("\(result) mb/s")
97 | view.updateProgress("\(index + 1)/\(blockCount)", Double(index + 1))
98 | }
99 |
100 | func updateUI() {
101 | let freeSpace = Double(interactor.freeSpaceInByte / (1000 * 1000 * 1000)) - 1.0
102 | view.updateSlider(freeSpaceInBytes: freeSpace)
103 |
104 | view.setupDiskSpaceLabels(
105 | all: spaceFormatter(bytes: interactor.totalSpaceInByte),
106 | used: spaceFormatter(bytes: interactor.usedSpaceInByte),
107 | free: spaceFormatter(bytes: interactor.freeSpaceInByte)
108 | )
109 | }
110 |
111 | func moveLogFile(to url: URL) {
112 | interactor.moveLogFile(to: url)
113 | }
114 |
115 | func showAlert(with message: String) {
116 | view.createAndShowErrorAlert(with: message)
117 | }
118 |
119 | // MARK: - Private methods
120 |
121 | private func spaceFormatter(bytes: Int64) -> String {
122 | return ByteCountFormatter.string(fromByteCount: bytes, countStyle: ByteCountFormatter.CountStyle.file)
123 | }
124 | }
125 |
--------------------------------------------------------------------------------
/Benchmark/Services/LoggerService.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LoggerService.swift
3 | // Benchmark
4 | //
5 | // Created by Kirill Varshamov on 13.12.2020.
6 | // Copyright © 2020 Kirill Varshamov. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | // MARK: - Protocols
12 |
13 | /// Base logger service protocol
14 | protocol LogService: class {
15 |
16 | /// Log file name
17 | var logFileName: String { get }
18 | }
19 |
20 |
21 | /// Logger service protocol for SSD module
22 | protocol SSDLogService: LogService {
23 |
24 | /// Create log file for write session
25 | /// - Parameter failure: Error handler
26 | func createLogFileForSSD(failure: @escaping (String) -> Void)
27 |
28 | /// Write log to write session's log file
29 | /// - Parameters:
30 | /// - index: Row index in log file
31 | /// - speed: Write speed
32 | /// - time: Write time
33 | func writeSSDLog(index: Int, speed: Int, time: Double)
34 | }
35 |
36 |
37 | /// Logger service protocol for Battery module
38 | protocol BatteryLogService: LogService {
39 |
40 | /// Create log file for battery stats
41 | /// - Parameter failure: Error handler
42 | func createLogFileForBattery(failure: @escaping (String) -> Void)
43 |
44 | /// Write log to battery's log file
45 | /// - Parameters:
46 | /// - temp: Battery's temperature
47 | /// - currentCap: Battery's current capacity
48 | /// - maxCap: Battery's maximum capacity
49 | /// - designCap: Battery's design capacity
50 | func writeBatteryLog(temp: NSNumber, currentCap: NSNumber, maxCap: NSNumber, designCap: NSNumber)
51 | }
52 |
53 | // MARK: - Logger Service
54 |
55 | /// Logger Service
56 | class LoggerService {
57 |
58 | /// Log file name
59 | var logFileName = ""
60 |
61 | private lazy var dateFormatter: DateFormatter = {
62 | let dateFormatter = DateFormatter()
63 | dateFormatter.locale = .init(identifier: "en_US")
64 | return dateFormatter
65 | }()
66 |
67 |
68 | /// Create log file
69 | /// - Parameters:
70 | /// - structure: CSV log structure
71 | /// - failure: Failure handler
72 | private func createLogFile(with structure: String, failure: @escaping (String) -> Void) {
73 | if let dir = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first {
74 |
75 | let fileURL = dir.appendingPathComponent(self.logFileName)
76 |
77 | do {
78 | try structure.write(to: fileURL, atomically: false, encoding: .utf8)
79 | } catch {
80 | failure("\(error.localizedDescription)\n\nCan't create log file")
81 | }
82 | }
83 | }
84 |
85 |
86 | /// Write log
87 | /// - Parameter data: Log data in CSV style
88 | private func writeLog(with data: String) {
89 | guard let stringData = data.data(using: .utf8) else {
90 | return
91 | }
92 |
93 | if let dir = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first {
94 |
95 | let fileURL = dir.appendingPathComponent(self.logFileName)
96 |
97 | if FileManager.default.fileExists(atPath: fileURL.path) {
98 | if let fileHandle = try? FileHandle(forWritingTo: fileURL) {
99 | fileHandle.seekToEndOfFile()
100 | fileHandle.write(stringData)
101 | fileHandle.closeFile()
102 | }
103 | }
104 | }
105 | }
106 | }
107 |
108 | // MARK: - SSDLogService
109 | extension LoggerService: SSDLogService {
110 |
111 | /// Create log file for write session
112 | /// - Parameter failure: Error handler
113 | func createLogFileForSSD(failure: @escaping (String) -> Void) {
114 | DispatchQueue.global(qos: .utility).async {
115 |
116 | self.dateFormatter.dateFormat = "HH-mm-ss"
117 |
118 | self.logFileName = "ssd_test+\(self.dateFormatter.string(from: Date())).csv"
119 |
120 | let structure = "Block;Speed;Time\n"
121 |
122 | self.createLogFile(with: structure, failure: failure)
123 | }
124 | }
125 |
126 | /// Write log to write session's log file
127 | /// - Parameters:
128 | /// - index: Row index in log file
129 | /// - speed: Write speed
130 | /// - time: Write time
131 | func writeSSDLog(index: Int, speed: Int, time: Double) {
132 | DispatchQueue.global(qos: .utility).async {
133 | let logData = "\(index);\(speed);\(time)\n"
134 |
135 | self.writeLog(with: logData)
136 | }
137 | }
138 | }
139 |
140 | // MARK: - BatteryLogService
141 | extension LoggerService: BatteryLogService {
142 |
143 | /// Create log file for battery stats
144 | /// - Parameter failure: Error handler
145 | func createLogFileForBattery(failure: @escaping (String) -> Void) {
146 | DispatchQueue.global(qos: .utility).async {
147 | self.dateFormatter.dateFormat = "HH-mm-ss"
148 |
149 | self.logFileName = "battery_test+\(self.dateFormatter.string(from: Date())).csv"
150 |
151 | let structure = "Time;Temperature;Current Capacity;Maximum capacity;Design capacity\n"
152 |
153 | self.createLogFile(with: structure, failure: failure)
154 | }
155 | }
156 |
157 | /// Write log to battery's log file
158 | /// - Parameters:
159 | /// - temp: Battery's temperature
160 | /// - currentCap: Battery's current capacity
161 | /// - maxCap: Battery's maximum capacity
162 | /// - designCap: Battery's design capacity
163 | func writeBatteryLog(temp: NSNumber, currentCap: NSNumber, maxCap: NSNumber, designCap: NSNumber) {
164 |
165 | DispatchQueue.global(qos: .utility).async {
166 | self.dateFormatter.dateFormat = "HH:mm:ss"
167 |
168 | let logData = self.dateFormatter.string(from: Date()) + ";\(temp);\(currentCap);\(maxCap);\(designCap)\n"
169 |
170 | self.writeLog(with: logData)
171 | }
172 | }
173 | }
174 |
--------------------------------------------------------------------------------
/Benchmark/Modules/SSD/SSDViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // Benchmark
4 | //
5 | // Created by Kirill Varshamov on 23.08.2020.
6 | // Copyright © 2020 Kirill Varshamov. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | class SSDViewController: NSViewController, SSDViewProtocol {
12 |
13 | // MARK: - Properties
14 | var presenter: SSDPresenterProtocol!
15 | let configurator: SSDConfiguratorProtocol = SSDConfigurator()
16 |
17 | var popoverGraph: NSPopover?
18 |
19 | // MARK: - Life cycle methods
20 | override func viewDidLoad() {
21 | super.viewDidLoad()
22 |
23 | configurator.configure(with: self)
24 | presenter.configureView()
25 |
26 | // TODO: Refactor
27 | graphButton.isHidden = true
28 | }
29 |
30 | // MARK: - Outlets
31 |
32 | // Labels
33 | @IBOutlet weak var allSpaceLabel: NSTextField!
34 | @IBOutlet weak var usedSpaceLabel: NSTextField!
35 | @IBOutlet weak var freeSpaceLabel: NSTextField!
36 | @IBOutlet weak var writeSpeedLabel: NSTextField!
37 | @IBOutlet weak var writeSpeedTitle: NSTextField!
38 | @IBOutlet weak var progressLabel: NSTextField!
39 |
40 | // Others
41 | @IBOutlet weak var inputValueTextField: NSTextField!
42 | @IBOutlet weak var sliderView: NSSlider!
43 | @IBOutlet weak var progressIndicator: NSProgressIndicator!
44 |
45 | // Buttons
46 | @IBOutlet weak var startButton: NSButton!
47 | @IBOutlet weak var stopButton: NSButton!
48 | @IBOutlet weak var exportButton: NSButton!
49 | @IBOutlet weak var clearButton: NSButton!
50 | @IBOutlet weak var graphButton: NSButton!
51 |
52 | // MARK: - Actions
53 | @objc func sliderMoved() {
54 | presenter.sliderMoved(with: sliderView.intValue)
55 | }
56 |
57 |
58 | @IBAction func interactionWithGraph(_ sender: NSButton) {
59 | if let popover = popoverGraph {
60 | popover.close()
61 | popoverGraph = nil
62 | } else {
63 | popoverGraph = NSPopover()
64 |
65 | let ssdGraphVC = SSDGraphViewController()
66 | ssdGraphVC.view.frame = CGRect(origin: .zero, size: CGSize(width: 150.0, height: 150.0))
67 |
68 | popoverGraph?.contentViewController = ssdGraphVC
69 | popoverGraph?.show(relativeTo: view.bounds, of: view, preferredEdge: NSRectEdge.minX)
70 |
71 | ssdGraphVC.buildGraph(with: presenter.currentLogName)
72 | }
73 | }
74 |
75 | // TODO refactor
76 | @IBAction func openLogFolder(_ sender: NSButton) {
77 | if let dir = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first {
78 | NSWorkspace.shared.open(dir)
79 | }
80 | }
81 |
82 | func isBlocksFolderEmpty() -> Bool {
83 | let dirPath = FileManager.default.homeDirectoryForCurrentUser.appendingPathComponent("SSDBlocks")
84 |
85 | do {
86 | let blocksURL = try FileManager.default.contentsOfDirectory(at: dirPath, includingPropertiesForKeys: nil, options: .skipsHiddenFiles)
87 |
88 | return blocksURL.isEmpty
89 | } catch {
90 | return false
91 | }
92 | }
93 |
94 | // TODO refactor
95 | @IBAction func removeAllBlocks(_ sender: Any) {
96 | DispatchQueue.global(qos: .utility).async {
97 | let dirPath = FileManager.default.homeDirectoryForCurrentUser.appendingPathComponent("SSDBlocks")
98 |
99 | do {
100 | let blocksURL = try FileManager.default.contentsOfDirectory(at: dirPath, includingPropertiesForKeys: nil, options: .skipsHiddenFiles)
101 |
102 | for blockURL in blocksURL {
103 | try FileManager.default.removeItem(at: blockURL)
104 | }
105 | } catch {
106 | self.createAndShowErrorAlert(with: "\(error.localizedDescription)\n\nYou can delete all blocks at ~/Library/Containers/Benchmark/data/SSDBlocks/")
107 | }
108 |
109 | self.presenter.updateUI()
110 | }
111 |
112 | clearButton.isEnabled = false
113 | }
114 |
115 | @IBAction func exportLog(_ sender: Any) {
116 | let panel = NSSavePanel()
117 |
118 | panel.nameFieldStringValue = presenter.currentLogName
119 |
120 | let result = panel.runModal()
121 |
122 | switch result {
123 | case .OK:
124 |
125 | guard let saveURL = panel.url else {
126 | return
127 | }
128 |
129 | presenter.moveLogFile(to: saveURL)
130 | default:
131 | print("Panel shouldn't be anything other than OK")
132 | }
133 |
134 | exportButton.isEnabled = false // TODO to presenter
135 | }
136 |
137 | @IBAction func startBenchmarkButtonTapped(_ sender: NSButton) {
138 | presenter.startButtonTapped()
139 | }
140 |
141 | @IBAction func stopBenchmarkButtonTapped(_ sender: NSButton) {
142 | presenter.stopButtonTapped()
143 | }
144 |
145 | // MARK: - SSDViewProtocol methods
146 | func setupSlider(freeSpaceInBytes: Double) {
147 | DispatchQueue.main.async {
148 | self.sliderView.target = self
149 | self.sliderView.action = #selector(self.sliderMoved)
150 |
151 | self.sliderView.isContinuous = true
152 |
153 | self.sliderView.minValue = 1.0
154 | self.sliderView.maxValue = freeSpaceInBytes
155 |
156 | self.sliderView.integerValue = 1
157 |
158 | }
159 | }
160 |
161 | func updateSlider(freeSpaceInBytes: Double) {
162 | DispatchQueue.main.async {
163 | self.sliderView.maxValue = freeSpaceInBytes
164 | self.sliderView.integerValue = 1
165 | }
166 | }
167 |
168 | func setupDiskSpaceLabels(all: String, used: String, free: String) {
169 | DispatchQueue.main.async {
170 | self.allSpaceLabel.stringValue = all
171 | self.usedSpaceLabel.stringValue = used
172 | self.freeSpaceLabel.stringValue = free
173 | }
174 | }
175 |
176 | func setupButtons() {
177 | DispatchQueue.main.async {
178 | self.stopButton.isEnabled = false
179 | self.exportButton.isEnabled = false
180 | self.clearButton.isEnabled = false
181 | }
182 | }
183 |
184 | func setupInputTextField() {
185 | DispatchQueue.main.async {
186 | self.inputValueTextField.delegate = self
187 | }
188 | }
189 |
190 | func updateSliderTextValue(with textValue: String) {
191 | DispatchQueue.main.async {
192 | self.inputValueTextField.stringValue = ""
193 | self.inputValueTextField.placeholderString = textValue
194 | }
195 | }
196 |
197 | func updateSliderValue(with intValue: Int32) {
198 | DispatchQueue.main.async {
199 | self.sliderView.intValue = intValue
200 | }
201 | }
202 |
203 | func createAndShowErrorAlert(with description: String) {
204 | DispatchQueue.main.async {
205 | let alert = NSAlert()
206 | alert.messageText = "Error"
207 | alert.informativeText = description
208 | alert.alertStyle = .warning
209 | alert.addButton(withTitle: "OK")
210 | alert.icon = NSImage(named: NSImage.cautionName)
211 | alert.runModal()
212 | }
213 | }
214 |
215 | func checkBlocksFolder() {
216 | DispatchQueue.main.async {
217 | self.clearButton.isEnabled = !self.isBlocksFolderEmpty()
218 | }
219 | }
220 |
221 | func resetUI() {
222 | DispatchQueue.main.async {
223 | self.progressLabel.isHidden = true
224 | self.progressIndicator.isHidden = true
225 | self.writeSpeedLabel.isHidden = true
226 | self.writeSpeedTitle.isHidden = true
227 |
228 | self.progressLabel.stringValue = ""
229 | self.progressIndicator.doubleValue = 0.0
230 |
231 | }
232 | }
233 |
234 | func endWrite() {
235 | DispatchQueue.main.async {
236 | self.startButton.isEnabled = true
237 | self.stopButton.isEnabled = false
238 | self.clearButton.isEnabled = true
239 | self.exportButton.isEnabled = true
240 | }
241 | }
242 |
243 | func changeUIForStart(blockCount: Int32) {
244 | DispatchQueue.main.async {
245 | self.stopButton.isEnabled = true
246 |
247 | self.exportButton.isEnabled = false
248 | self.startButton.isEnabled = false
249 | self.writeSpeedLabel.stringValue = "0 mb/s"
250 | self.progressIndicator.maxValue = Double(blockCount)
251 | self.progressLabel.stringValue = "0/\(blockCount)"
252 | self.progressIndicator.doubleValue = 0.0
253 | self.progressLabel.isHidden = false
254 | self.progressIndicator.isHidden = false
255 | self.writeSpeedLabel.isHidden = false
256 | self.writeSpeedTitle.isHidden = false
257 | }
258 | }
259 |
260 | func updateWriteSpeed(_ speed: String) {
261 | DispatchQueue.main.async {
262 | self.writeSpeedLabel.stringValue = speed
263 | }
264 | }
265 |
266 | func updateProgress(_ label: String, _ indicator: Double) {
267 | DispatchQueue.main.async {
268 | self.progressLabel.stringValue = label
269 | self.progressIndicator.doubleValue = indicator
270 | }
271 | }
272 | }
273 |
274 | extension SSDViewController: NSTextFieldDelegate {
275 | func control(_ control: NSControl, textShouldEndEditing fieldEditor: NSText) -> Bool {
276 |
277 | presenter.textFieldUpdated(with: fieldEditor.string, maxValue: self.sliderView.maxValue)
278 |
279 | return true
280 | }
281 |
282 | func controlTextDidChange(_ obj: Notification) {
283 | presenter.textFieldUpdated(with: self.inputValueTextField.stringValue, maxValue: self.sliderView.maxValue)
284 | }
285 | }
286 |
--------------------------------------------------------------------------------
/Benchmark.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 7E87B5CB24F2FBF300FF3D20 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E87B5CA24F2FBF300FF3D20 /* AppDelegate.swift */; };
11 | 7E87B5CD24F2FBF300FF3D20 /* SSDViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E87B5CC24F2FBF300FF3D20 /* SSDViewController.swift */; };
12 | 7E87B5CF24F2FBF400FF3D20 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7E87B5CE24F2FBF400FF3D20 /* Assets.xcassets */; };
13 | 7E87B5D224F2FBF400FF3D20 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7E87B5D024F2FBF400FF3D20 /* Main.storyboard */; };
14 | 7E87B5DE24F2FBF400FF3D20 /* BenchmarkTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E87B5DD24F2FBF400FF3D20 /* BenchmarkTests.swift */; };
15 | 7E87B5EB24F2FEAC00FF3D20 /* SSDInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E87B5EA24F2FEAC00FF3D20 /* SSDInteractor.swift */; };
16 | 7E87B5ED24F2FEB600FF3D20 /* SSDPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E87B5EC24F2FEB600FF3D20 /* SSDPresenter.swift */; };
17 | 7E87B5EF24F2FEC500FF3D20 /* SSDConfigurator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E87B5EE24F2FEC500FF3D20 /* SSDConfigurator.swift */; };
18 | 7E87B5F124F2FED700FF3D20 /* SSDRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E87B5F024F2FED700FF3D20 /* SSDRouter.swift */; };
19 | 7E87B5F324F2FEE400FF3D20 /* SSDProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E87B5F224F2FEE400FF3D20 /* SSDProtocols.swift */; };
20 | 7E87B5FA24F309B600FF3D20 /* StorageInfoService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E87B5F924F309B600FF3D20 /* StorageInfoService.swift */; };
21 | 7E9CD60E25763B1F005A766B /* BatteryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E9CD60D25763B1F005A766B /* BatteryViewController.swift */; };
22 | 7ED42A6725753B240091805B /* KABattery.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED42A6625753B240091805B /* KABattery.m */; };
23 | 7ED8EA172586144300A9C3DD /* BlockWriteOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7ED8EA162586144300A9C3DD /* BlockWriteOperation.swift */; };
24 | 7ED8EA1B2586165800A9C3DD /* LoggerService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7ED8EA1A2586165800A9C3DD /* LoggerService.swift */; };
25 | 7EEB240C25A3BBB400D59532 /* SSDGraphViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EEB240B25A3BBB400D59532 /* SSDGraphViewController.swift */; };
26 | /* End PBXBuildFile section */
27 |
28 | /* Begin PBXContainerItemProxy section */
29 | 7E87B5DA24F2FBF400FF3D20 /* PBXContainerItemProxy */ = {
30 | isa = PBXContainerItemProxy;
31 | containerPortal = 7E87B5BF24F2FBF300FF3D20 /* Project object */;
32 | proxyType = 1;
33 | remoteGlobalIDString = 7E87B5C624F2FBF300FF3D20;
34 | remoteInfo = Benchmark;
35 | };
36 | /* End PBXContainerItemProxy section */
37 |
38 | /* Begin PBXFileReference section */
39 | 7E87B5C724F2FBF300FF3D20 /* Benchmark.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Benchmark.app; sourceTree = BUILT_PRODUCTS_DIR; };
40 | 7E87B5CA24F2FBF300FF3D20 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
41 | 7E87B5CC24F2FBF300FF3D20 /* SSDViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SSDViewController.swift; sourceTree = ""; };
42 | 7E87B5CE24F2FBF400FF3D20 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
43 | 7E87B5D124F2FBF400FF3D20 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
44 | 7E87B5D324F2FBF400FF3D20 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
45 | 7E87B5D424F2FBF400FF3D20 /* Benchmark.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Benchmark.entitlements; sourceTree = ""; };
46 | 7E87B5D924F2FBF400FF3D20 /* BenchmarkTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BenchmarkTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
47 | 7E87B5DD24F2FBF400FF3D20 /* BenchmarkTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BenchmarkTests.swift; sourceTree = ""; };
48 | 7E87B5DF24F2FBF400FF3D20 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
49 | 7E87B5EA24F2FEAC00FF3D20 /* SSDInteractor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SSDInteractor.swift; sourceTree = ""; };
50 | 7E87B5EC24F2FEB600FF3D20 /* SSDPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SSDPresenter.swift; sourceTree = ""; };
51 | 7E87B5EE24F2FEC500FF3D20 /* SSDConfigurator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SSDConfigurator.swift; sourceTree = ""; };
52 | 7E87B5F024F2FED700FF3D20 /* SSDRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SSDRouter.swift; sourceTree = ""; };
53 | 7E87B5F224F2FEE400FF3D20 /* SSDProtocols.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SSDProtocols.swift; sourceTree = ""; };
54 | 7E87B5F924F309B600FF3D20 /* StorageInfoService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StorageInfoService.swift; sourceTree = ""; };
55 | 7E9CD60D25763B1F005A766B /* BatteryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BatteryViewController.swift; sourceTree = ""; };
56 | 7ED42A6525753B240091805B /* Benchmark-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Benchmark-Bridging-Header.h"; sourceTree = ""; };
57 | 7ED42A6625753B240091805B /* KABattery.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KABattery.m; sourceTree = ""; };
58 | 7ED42A6A25753B330091805B /* KABattery.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KABattery.h; sourceTree = ""; };
59 | 7ED8EA162586144300A9C3DD /* BlockWriteOperation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlockWriteOperation.swift; sourceTree = ""; };
60 | 7ED8EA1A2586165800A9C3DD /* LoggerService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoggerService.swift; sourceTree = ""; };
61 | 7EEB240B25A3BBB400D59532 /* SSDGraphViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SSDGraphViewController.swift; sourceTree = ""; };
62 | /* End PBXFileReference section */
63 |
64 | /* Begin PBXFrameworksBuildPhase section */
65 | 7E87B5C424F2FBF300FF3D20 /* Frameworks */ = {
66 | isa = PBXFrameworksBuildPhase;
67 | buildActionMask = 2147483647;
68 | files = (
69 | );
70 | runOnlyForDeploymentPostprocessing = 0;
71 | };
72 | 7E87B5D624F2FBF400FF3D20 /* Frameworks */ = {
73 | isa = PBXFrameworksBuildPhase;
74 | buildActionMask = 2147483647;
75 | files = (
76 | );
77 | runOnlyForDeploymentPostprocessing = 0;
78 | };
79 | /* End PBXFrameworksBuildPhase section */
80 |
81 | /* Begin PBXGroup section */
82 | 7E87B5BE24F2FBF300FF3D20 = {
83 | isa = PBXGroup;
84 | children = (
85 | 7E87B5C924F2FBF300FF3D20 /* Benchmark */,
86 | 7E87B5DC24F2FBF400FF3D20 /* BenchmarkTests */,
87 | 7E87B5C824F2FBF300FF3D20 /* Products */,
88 | );
89 | sourceTree = "";
90 | };
91 | 7E87B5C824F2FBF300FF3D20 /* Products */ = {
92 | isa = PBXGroup;
93 | children = (
94 | 7E87B5C724F2FBF300FF3D20 /* Benchmark.app */,
95 | 7E87B5D924F2FBF400FF3D20 /* BenchmarkTests.xctest */,
96 | );
97 | name = Products;
98 | sourceTree = "";
99 | };
100 | 7E87B5C924F2FBF300FF3D20 /* Benchmark */ = {
101 | isa = PBXGroup;
102 | children = (
103 | 7E87B5D424F2FBF400FF3D20 /* Benchmark.entitlements */,
104 | 7E87B5D324F2FBF400FF3D20 /* Info.plist */,
105 | 7E87B5F624F3041F00FF3D20 /* App Delegate */,
106 | 7E87B5F524F303FB00FF3D20 /* Entities */,
107 | 7E87B5E824F2FE4000FF3D20 /* Modules */,
108 | 7E87B5F724F3044400FF3D20 /* Resources */,
109 | 7E87B5F424F303F500FF3D20 /* Services */,
110 | 7E87B5F824F3046A00FF3D20 /* Storyboards */,
111 | );
112 | path = Benchmark;
113 | sourceTree = "";
114 | };
115 | 7E87B5DC24F2FBF400FF3D20 /* BenchmarkTests */ = {
116 | isa = PBXGroup;
117 | children = (
118 | 7E87B5DD24F2FBF400FF3D20 /* BenchmarkTests.swift */,
119 | 7E87B5DF24F2FBF400FF3D20 /* Info.plist */,
120 | );
121 | path = BenchmarkTests;
122 | sourceTree = "";
123 | };
124 | 7E87B5E824F2FE4000FF3D20 /* Modules */ = {
125 | isa = PBXGroup;
126 | children = (
127 | 7ED42A6225753A030091805B /* Battery */,
128 | 7E87B5E924F2FE6500FF3D20 /* SSD */,
129 | );
130 | path = Modules;
131 | sourceTree = "";
132 | };
133 | 7E87B5E924F2FE6500FF3D20 /* SSD */ = {
134 | isa = PBXGroup;
135 | children = (
136 | 7EEB240A25A3BB9E00D59532 /* SSD Graph */,
137 | 7E87B5CC24F2FBF300FF3D20 /* SSDViewController.swift */,
138 | 7E87B5EA24F2FEAC00FF3D20 /* SSDInteractor.swift */,
139 | 7E87B5EC24F2FEB600FF3D20 /* SSDPresenter.swift */,
140 | 7E87B5EE24F2FEC500FF3D20 /* SSDConfigurator.swift */,
141 | 7E87B5F024F2FED700FF3D20 /* SSDRouter.swift */,
142 | 7E87B5F224F2FEE400FF3D20 /* SSDProtocols.swift */,
143 | );
144 | path = SSD;
145 | sourceTree = "";
146 | };
147 | 7E87B5F424F303F500FF3D20 /* Services */ = {
148 | isa = PBXGroup;
149 | children = (
150 | 7E87B5F924F309B600FF3D20 /* StorageInfoService.swift */,
151 | 7ED8EA162586144300A9C3DD /* BlockWriteOperation.swift */,
152 | 7ED8EA1A2586165800A9C3DD /* LoggerService.swift */,
153 | );
154 | path = Services;
155 | sourceTree = "";
156 | };
157 | 7E87B5F524F303FB00FF3D20 /* Entities */ = {
158 | isa = PBXGroup;
159 | children = (
160 | );
161 | path = Entities;
162 | sourceTree = "";
163 | };
164 | 7E87B5F624F3041F00FF3D20 /* App Delegate */ = {
165 | isa = PBXGroup;
166 | children = (
167 | 7E87B5CA24F2FBF300FF3D20 /* AppDelegate.swift */,
168 | );
169 | path = "App Delegate";
170 | sourceTree = "";
171 | };
172 | 7E87B5F724F3044400FF3D20 /* Resources */ = {
173 | isa = PBXGroup;
174 | children = (
175 | 7E87B5CE24F2FBF400FF3D20 /* Assets.xcassets */,
176 | );
177 | path = Resources;
178 | sourceTree = "";
179 | };
180 | 7E87B5F824F3046A00FF3D20 /* Storyboards */ = {
181 | isa = PBXGroup;
182 | children = (
183 | 7E87B5D024F2FBF400FF3D20 /* Main.storyboard */,
184 | );
185 | path = Storyboards;
186 | sourceTree = "";
187 | };
188 | 7ED42A6225753A030091805B /* Battery */ = {
189 | isa = PBXGroup;
190 | children = (
191 | 7ED42A6625753B240091805B /* KABattery.m */,
192 | 7ED42A6A25753B330091805B /* KABattery.h */,
193 | 7ED42A6525753B240091805B /* Benchmark-Bridging-Header.h */,
194 | 7E9CD60D25763B1F005A766B /* BatteryViewController.swift */,
195 | );
196 | path = Battery;
197 | sourceTree = "";
198 | };
199 | 7EEB240A25A3BB9E00D59532 /* SSD Graph */ = {
200 | isa = PBXGroup;
201 | children = (
202 | 7EEB240B25A3BBB400D59532 /* SSDGraphViewController.swift */,
203 | );
204 | path = "SSD Graph";
205 | sourceTree = "";
206 | };
207 | /* End PBXGroup section */
208 |
209 | /* Begin PBXNativeTarget section */
210 | 7E87B5C624F2FBF300FF3D20 /* Benchmark */ = {
211 | isa = PBXNativeTarget;
212 | buildConfigurationList = 7E87B5E224F2FBF400FF3D20 /* Build configuration list for PBXNativeTarget "Benchmark" */;
213 | buildPhases = (
214 | 7E87B5C324F2FBF300FF3D20 /* Sources */,
215 | 7E87B5C424F2FBF300FF3D20 /* Frameworks */,
216 | 7E87B5C524F2FBF300FF3D20 /* Resources */,
217 | );
218 | buildRules = (
219 | );
220 | dependencies = (
221 | );
222 | name = Benchmark;
223 | productName = Benchmark;
224 | productReference = 7E87B5C724F2FBF300FF3D20 /* Benchmark.app */;
225 | productType = "com.apple.product-type.application";
226 | };
227 | 7E87B5D824F2FBF400FF3D20 /* BenchmarkTests */ = {
228 | isa = PBXNativeTarget;
229 | buildConfigurationList = 7E87B5E524F2FBF400FF3D20 /* Build configuration list for PBXNativeTarget "BenchmarkTests" */;
230 | buildPhases = (
231 | 7E87B5D524F2FBF400FF3D20 /* Sources */,
232 | 7E87B5D624F2FBF400FF3D20 /* Frameworks */,
233 | 7E87B5D724F2FBF400FF3D20 /* Resources */,
234 | );
235 | buildRules = (
236 | );
237 | dependencies = (
238 | 7E87B5DB24F2FBF400FF3D20 /* PBXTargetDependency */,
239 | );
240 | name = BenchmarkTests;
241 | productName = BenchmarkTests;
242 | productReference = 7E87B5D924F2FBF400FF3D20 /* BenchmarkTests.xctest */;
243 | productType = "com.apple.product-type.bundle.unit-test";
244 | };
245 | /* End PBXNativeTarget section */
246 |
247 | /* Begin PBXProject section */
248 | 7E87B5BF24F2FBF300FF3D20 /* Project object */ = {
249 | isa = PBXProject;
250 | attributes = {
251 | CLASSPREFIX = KA;
252 | LastSwiftUpdateCheck = 1160;
253 | LastUpgradeCheck = 1220;
254 | ORGANIZATIONNAME = "Kirill Varshamov";
255 | TargetAttributes = {
256 | 7E87B5C624F2FBF300FF3D20 = {
257 | CreatedOnToolsVersion = 11.6;
258 | LastSwiftMigration = 1220;
259 | };
260 | 7E87B5D824F2FBF400FF3D20 = {
261 | CreatedOnToolsVersion = 11.6;
262 | TestTargetID = 7E87B5C624F2FBF300FF3D20;
263 | };
264 | };
265 | };
266 | buildConfigurationList = 7E87B5C224F2FBF300FF3D20 /* Build configuration list for PBXProject "Benchmark" */;
267 | compatibilityVersion = "Xcode 9.3";
268 | developmentRegion = en;
269 | hasScannedForEncodings = 0;
270 | knownRegions = (
271 | en,
272 | Base,
273 | );
274 | mainGroup = 7E87B5BE24F2FBF300FF3D20;
275 | productRefGroup = 7E87B5C824F2FBF300FF3D20 /* Products */;
276 | projectDirPath = "";
277 | projectRoot = "";
278 | targets = (
279 | 7E87B5C624F2FBF300FF3D20 /* Benchmark */,
280 | 7E87B5D824F2FBF400FF3D20 /* BenchmarkTests */,
281 | );
282 | };
283 | /* End PBXProject section */
284 |
285 | /* Begin PBXResourcesBuildPhase section */
286 | 7E87B5C524F2FBF300FF3D20 /* Resources */ = {
287 | isa = PBXResourcesBuildPhase;
288 | buildActionMask = 2147483647;
289 | files = (
290 | 7E87B5CF24F2FBF400FF3D20 /* Assets.xcassets in Resources */,
291 | 7E87B5D224F2FBF400FF3D20 /* Main.storyboard in Resources */,
292 | );
293 | runOnlyForDeploymentPostprocessing = 0;
294 | };
295 | 7E87B5D724F2FBF400FF3D20 /* Resources */ = {
296 | isa = PBXResourcesBuildPhase;
297 | buildActionMask = 2147483647;
298 | files = (
299 | );
300 | runOnlyForDeploymentPostprocessing = 0;
301 | };
302 | /* End PBXResourcesBuildPhase section */
303 |
304 | /* Begin PBXSourcesBuildPhase section */
305 | 7E87B5C324F2FBF300FF3D20 /* Sources */ = {
306 | isa = PBXSourcesBuildPhase;
307 | buildActionMask = 2147483647;
308 | files = (
309 | 7E9CD60E25763B1F005A766B /* BatteryViewController.swift in Sources */,
310 | 7E87B5EF24F2FEC500FF3D20 /* SSDConfigurator.swift in Sources */,
311 | 7ED8EA172586144300A9C3DD /* BlockWriteOperation.swift in Sources */,
312 | 7ED42A6725753B240091805B /* KABattery.m in Sources */,
313 | 7E87B5F324F2FEE400FF3D20 /* SSDProtocols.swift in Sources */,
314 | 7E87B5F124F2FED700FF3D20 /* SSDRouter.swift in Sources */,
315 | 7E87B5CD24F2FBF300FF3D20 /* SSDViewController.swift in Sources */,
316 | 7EEB240C25A3BBB400D59532 /* SSDGraphViewController.swift in Sources */,
317 | 7E87B5EB24F2FEAC00FF3D20 /* SSDInteractor.swift in Sources */,
318 | 7E87B5FA24F309B600FF3D20 /* StorageInfoService.swift in Sources */,
319 | 7E87B5CB24F2FBF300FF3D20 /* AppDelegate.swift in Sources */,
320 | 7E87B5ED24F2FEB600FF3D20 /* SSDPresenter.swift in Sources */,
321 | 7ED8EA1B2586165800A9C3DD /* LoggerService.swift in Sources */,
322 | );
323 | runOnlyForDeploymentPostprocessing = 0;
324 | };
325 | 7E87B5D524F2FBF400FF3D20 /* Sources */ = {
326 | isa = PBXSourcesBuildPhase;
327 | buildActionMask = 2147483647;
328 | files = (
329 | 7E87B5DE24F2FBF400FF3D20 /* BenchmarkTests.swift in Sources */,
330 | );
331 | runOnlyForDeploymentPostprocessing = 0;
332 | };
333 | /* End PBXSourcesBuildPhase section */
334 |
335 | /* Begin PBXTargetDependency section */
336 | 7E87B5DB24F2FBF400FF3D20 /* PBXTargetDependency */ = {
337 | isa = PBXTargetDependency;
338 | target = 7E87B5C624F2FBF300FF3D20 /* Benchmark */;
339 | targetProxy = 7E87B5DA24F2FBF400FF3D20 /* PBXContainerItemProxy */;
340 | };
341 | /* End PBXTargetDependency section */
342 |
343 | /* Begin PBXVariantGroup section */
344 | 7E87B5D024F2FBF400FF3D20 /* Main.storyboard */ = {
345 | isa = PBXVariantGroup;
346 | children = (
347 | 7E87B5D124F2FBF400FF3D20 /* Base */,
348 | );
349 | name = Main.storyboard;
350 | sourceTree = "";
351 | };
352 | /* End PBXVariantGroup section */
353 |
354 | /* Begin XCBuildConfiguration section */
355 | 7E87B5E024F2FBF400FF3D20 /* Debug */ = {
356 | isa = XCBuildConfiguration;
357 | buildSettings = {
358 | ALWAYS_SEARCH_USER_PATHS = NO;
359 | CLANG_ANALYZER_NONNULL = YES;
360 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
361 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
362 | CLANG_CXX_LIBRARY = "libc++";
363 | CLANG_ENABLE_MODULES = YES;
364 | CLANG_ENABLE_OBJC_ARC = YES;
365 | CLANG_ENABLE_OBJC_WEAK = YES;
366 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
367 | CLANG_WARN_BOOL_CONVERSION = YES;
368 | CLANG_WARN_COMMA = YES;
369 | CLANG_WARN_CONSTANT_CONVERSION = YES;
370 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
371 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
372 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
373 | CLANG_WARN_EMPTY_BODY = YES;
374 | CLANG_WARN_ENUM_CONVERSION = YES;
375 | CLANG_WARN_INFINITE_RECURSION = YES;
376 | CLANG_WARN_INT_CONVERSION = YES;
377 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
378 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
379 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
380 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
381 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
382 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
383 | CLANG_WARN_STRICT_PROTOTYPES = YES;
384 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
385 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
386 | CLANG_WARN_UNREACHABLE_CODE = YES;
387 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
388 | COPY_PHASE_STRIP = NO;
389 | DEBUG_INFORMATION_FORMAT = dwarf;
390 | ENABLE_STRICT_OBJC_MSGSEND = YES;
391 | ENABLE_TESTABILITY = YES;
392 | GCC_C_LANGUAGE_STANDARD = gnu11;
393 | GCC_DYNAMIC_NO_PIC = NO;
394 | GCC_NO_COMMON_BLOCKS = YES;
395 | GCC_OPTIMIZATION_LEVEL = 0;
396 | GCC_PREPROCESSOR_DEFINITIONS = (
397 | "DEBUG=1",
398 | "$(inherited)",
399 | );
400 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
401 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
402 | GCC_WARN_UNDECLARED_SELECTOR = YES;
403 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
404 | GCC_WARN_UNUSED_FUNCTION = YES;
405 | GCC_WARN_UNUSED_VARIABLE = YES;
406 | MACOSX_DEPLOYMENT_TARGET = 10.15;
407 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
408 | MTL_FAST_MATH = YES;
409 | ONLY_ACTIVE_ARCH = YES;
410 | SDKROOT = macosx;
411 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
412 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
413 | };
414 | name = Debug;
415 | };
416 | 7E87B5E124F2FBF400FF3D20 /* Release */ = {
417 | isa = XCBuildConfiguration;
418 | buildSettings = {
419 | ALWAYS_SEARCH_USER_PATHS = NO;
420 | CLANG_ANALYZER_NONNULL = YES;
421 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
422 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
423 | CLANG_CXX_LIBRARY = "libc++";
424 | CLANG_ENABLE_MODULES = YES;
425 | CLANG_ENABLE_OBJC_ARC = YES;
426 | CLANG_ENABLE_OBJC_WEAK = YES;
427 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
428 | CLANG_WARN_BOOL_CONVERSION = YES;
429 | CLANG_WARN_COMMA = YES;
430 | CLANG_WARN_CONSTANT_CONVERSION = YES;
431 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
432 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
433 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
434 | CLANG_WARN_EMPTY_BODY = YES;
435 | CLANG_WARN_ENUM_CONVERSION = YES;
436 | CLANG_WARN_INFINITE_RECURSION = YES;
437 | CLANG_WARN_INT_CONVERSION = YES;
438 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
439 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
440 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
441 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
442 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
443 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
444 | CLANG_WARN_STRICT_PROTOTYPES = YES;
445 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
446 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
447 | CLANG_WARN_UNREACHABLE_CODE = YES;
448 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
449 | COPY_PHASE_STRIP = NO;
450 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
451 | ENABLE_NS_ASSERTIONS = NO;
452 | ENABLE_STRICT_OBJC_MSGSEND = YES;
453 | GCC_C_LANGUAGE_STANDARD = gnu11;
454 | GCC_NO_COMMON_BLOCKS = YES;
455 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
456 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
457 | GCC_WARN_UNDECLARED_SELECTOR = YES;
458 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
459 | GCC_WARN_UNUSED_FUNCTION = YES;
460 | GCC_WARN_UNUSED_VARIABLE = YES;
461 | MACOSX_DEPLOYMENT_TARGET = 10.15;
462 | MTL_ENABLE_DEBUG_INFO = NO;
463 | MTL_FAST_MATH = YES;
464 | SDKROOT = macosx;
465 | SWIFT_COMPILATION_MODE = wholemodule;
466 | SWIFT_OPTIMIZATION_LEVEL = "-O";
467 | };
468 | name = Release;
469 | };
470 | 7E87B5E324F2FBF400FF3D20 /* Debug */ = {
471 | isa = XCBuildConfiguration;
472 | buildSettings = {
473 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
474 | CLANG_ENABLE_MODULES = YES;
475 | CODE_SIGN_ENTITLEMENTS = Benchmark/Benchmark.entitlements;
476 | CODE_SIGN_IDENTITY = "Apple Development";
477 | CODE_SIGN_STYLE = Automatic;
478 | COMBINE_HIDPI_IMAGES = YES;
479 | CURRENT_PROJECT_VERSION = 3;
480 | DEVELOPMENT_TEAM = 82CJ7XMF7V;
481 | ENABLE_HARDENED_RUNTIME = YES;
482 | INFOPLIST_FILE = Benchmark/Info.plist;
483 | LD_RUNPATH_SEARCH_PATHS = (
484 | "$(inherited)",
485 | "@executable_path/../Frameworks",
486 | );
487 | MACOSX_DEPLOYMENT_TARGET = 10.15;
488 | MARKETING_VERSION = 0.1;
489 | PRODUCT_BUNDLE_IDENTIFIER = Kaviro.Benchmark;
490 | PRODUCT_NAME = "$(TARGET_NAME)";
491 | SWIFT_OBJC_BRIDGING_HEADER = "Benchmark/Modules/Battery/Benchmark-Bridging-Header.h";
492 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
493 | SWIFT_VERSION = 5.0;
494 | };
495 | name = Debug;
496 | };
497 | 7E87B5E424F2FBF400FF3D20 /* Release */ = {
498 | isa = XCBuildConfiguration;
499 | buildSettings = {
500 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
501 | CLANG_ENABLE_MODULES = YES;
502 | CODE_SIGN_ENTITLEMENTS = Benchmark/Benchmark.entitlements;
503 | CODE_SIGN_IDENTITY = "Apple Development";
504 | CODE_SIGN_STYLE = Automatic;
505 | COMBINE_HIDPI_IMAGES = YES;
506 | CURRENT_PROJECT_VERSION = 3;
507 | DEVELOPMENT_TEAM = 82CJ7XMF7V;
508 | ENABLE_HARDENED_RUNTIME = YES;
509 | INFOPLIST_FILE = Benchmark/Info.plist;
510 | LD_RUNPATH_SEARCH_PATHS = (
511 | "$(inherited)",
512 | "@executable_path/../Frameworks",
513 | );
514 | MACOSX_DEPLOYMENT_TARGET = 10.15;
515 | MARKETING_VERSION = 0.1;
516 | PRODUCT_BUNDLE_IDENTIFIER = Kaviro.Benchmark;
517 | PRODUCT_NAME = "$(TARGET_NAME)";
518 | SWIFT_OBJC_BRIDGING_HEADER = "Benchmark/Modules/Battery/Benchmark-Bridging-Header.h";
519 | SWIFT_VERSION = 5.0;
520 | };
521 | name = Release;
522 | };
523 | 7E87B5E624F2FBF400FF3D20 /* Debug */ = {
524 | isa = XCBuildConfiguration;
525 | buildSettings = {
526 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
527 | BUNDLE_LOADER = "$(TEST_HOST)";
528 | CODE_SIGN_STYLE = Automatic;
529 | COMBINE_HIDPI_IMAGES = YES;
530 | DEVELOPMENT_TEAM = 82CJ7XMF7V;
531 | INFOPLIST_FILE = BenchmarkTests/Info.plist;
532 | LD_RUNPATH_SEARCH_PATHS = (
533 | "$(inherited)",
534 | "@executable_path/../Frameworks",
535 | "@loader_path/../Frameworks",
536 | );
537 | MACOSX_DEPLOYMENT_TARGET = 10.15;
538 | PRODUCT_BUNDLE_IDENTIFIER = Kaviro.BenchmarkTests;
539 | PRODUCT_NAME = "$(TARGET_NAME)";
540 | SWIFT_VERSION = 5.0;
541 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Benchmark.app/Contents/MacOS/Benchmark";
542 | };
543 | name = Debug;
544 | };
545 | 7E87B5E724F2FBF400FF3D20 /* Release */ = {
546 | isa = XCBuildConfiguration;
547 | buildSettings = {
548 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
549 | BUNDLE_LOADER = "$(TEST_HOST)";
550 | CODE_SIGN_STYLE = Automatic;
551 | COMBINE_HIDPI_IMAGES = YES;
552 | DEVELOPMENT_TEAM = 82CJ7XMF7V;
553 | INFOPLIST_FILE = BenchmarkTests/Info.plist;
554 | LD_RUNPATH_SEARCH_PATHS = (
555 | "$(inherited)",
556 | "@executable_path/../Frameworks",
557 | "@loader_path/../Frameworks",
558 | );
559 | MACOSX_DEPLOYMENT_TARGET = 10.15;
560 | PRODUCT_BUNDLE_IDENTIFIER = Kaviro.BenchmarkTests;
561 | PRODUCT_NAME = "$(TARGET_NAME)";
562 | SWIFT_VERSION = 5.0;
563 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Benchmark.app/Contents/MacOS/Benchmark";
564 | };
565 | name = Release;
566 | };
567 | /* End XCBuildConfiguration section */
568 |
569 | /* Begin XCConfigurationList section */
570 | 7E87B5C224F2FBF300FF3D20 /* Build configuration list for PBXProject "Benchmark" */ = {
571 | isa = XCConfigurationList;
572 | buildConfigurations = (
573 | 7E87B5E024F2FBF400FF3D20 /* Debug */,
574 | 7E87B5E124F2FBF400FF3D20 /* Release */,
575 | );
576 | defaultConfigurationIsVisible = 0;
577 | defaultConfigurationName = Release;
578 | };
579 | 7E87B5E224F2FBF400FF3D20 /* Build configuration list for PBXNativeTarget "Benchmark" */ = {
580 | isa = XCConfigurationList;
581 | buildConfigurations = (
582 | 7E87B5E324F2FBF400FF3D20 /* Debug */,
583 | 7E87B5E424F2FBF400FF3D20 /* Release */,
584 | );
585 | defaultConfigurationIsVisible = 0;
586 | defaultConfigurationName = Release;
587 | };
588 | 7E87B5E524F2FBF400FF3D20 /* Build configuration list for PBXNativeTarget "BenchmarkTests" */ = {
589 | isa = XCConfigurationList;
590 | buildConfigurations = (
591 | 7E87B5E624F2FBF400FF3D20 /* Debug */,
592 | 7E87B5E724F2FBF400FF3D20 /* Release */,
593 | );
594 | defaultConfigurationIsVisible = 0;
595 | defaultConfigurationName = Release;
596 | };
597 | /* End XCConfigurationList section */
598 | };
599 | rootObject = 7E87B5BF24F2FBF300FF3D20 /* Project object */;
600 | }
601 |
--------------------------------------------------------------------------------
/Benchmark/Storyboards/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
674 |
675 |
676 |
677 |
678 |
679 |
680 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
725 |
736 |
747 |
748 |
749 |
750 |
751 |
752 |
753 |
754 |
755 |
756 |
757 |
758 |
759 |
760 |
761 |
762 |
763 |
764 |
765 |
766 |
767 |
768 |
769 |
770 |
771 |
772 |
773 |
774 |
775 |
776 |
777 |
778 |
779 |
780 |
781 |
782 |
783 |
784 |
785 |
786 |
787 |
788 |
789 |
790 |
791 |
792 |
793 |
794 |
795 |
796 |
797 |
798 |
799 |
800 |
801 |
802 |
803 |
804 |
815 |
826 |
827 |
828 |
829 |
830 |
831 |
832 |
833 |
834 |
835 |
836 |
837 |
838 |
839 |
840 |
841 |
842 |
843 |
844 |
845 |
846 |
847 |
848 |
849 |
850 |
851 |
852 |
853 |
854 |
855 |
856 |
857 |
858 |
859 |
860 |
861 |
862 |
863 |
864 |
865 |
866 |
867 |
868 |
869 |
870 |
871 |
872 |
873 |
874 |
875 |
876 |
877 |
878 |
879 |
880 |
891 |
892 |
893 |
894 |
895 |
896 |
897 |
898 |
899 |
900 |
901 |
902 |
903 |
904 |
905 |
906 |
907 |
908 |
909 |
910 |
911 |
912 |
913 |
914 |
915 |
916 |
917 |
918 |
919 |
920 |
921 |
922 |
923 |
924 |
925 |
926 |
927 |
928 |
929 |
930 |
931 |
932 |
933 |
934 |
935 |
946 |
957 |
968 |
969 |
970 |
971 |
972 |
973 |
974 |
975 |
976 |
977 |
978 |
979 |
980 |
981 |
982 |
983 |
984 |
985 |
986 |
987 |
988 |
989 |
990 |
991 |
992 |
993 |
994 |
995 |
996 |
997 |
998 |
999 |
1000 |
1001 |
1002 |
1003 |
1004 |
1005 |
1006 |
1007 |
1008 |
1009 |
1010 |
1011 |
1012 |
1013 |
1014 |
1015 |
1016 |
1017 |
1018 |
1019 |
1020 |
1021 |
1022 |
1023 |
1024 |
1025 |
--------------------------------------------------------------------------------