Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup vars #70

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions ETTrace/ETTraceRunner/RunnerHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,27 +97,23 @@ class RunnerHelper {
symbolicator: symbolicator)
let outputUrl = URL(fileURLWithPath: FileManager.default.currentDirectoryPath)

var allThreads:[Flamegraph] = []
var mainThreadFlamegraph: Flamegraph!
var mainThreadData: Data!
var mainThreadData: Data?
for (threadId, symbolicationResult) in zip(threadIds, flamegraphs) {
let thread = responseData.threads[threadId]!
let flamegraph = createFlamegraphForThread(symbolicationResult.0, symbolicationResult.1, thread, responseData)
allThreads.append(flamegraph)

let outJsonData = JSONWrapper.toData(flamegraph)!

if thread.name == "Main Thread" {
if verbose {
try symbolicationResult.2.write(toFile: "output.folded", atomically: true, encoding: .utf8)
}
mainThreadFlamegraph = flamegraph
mainThreadData = outJsonData
}
try saveFlamegraph(outJsonData, outputUrl, threadId)
}

guard mainThreadFlamegraph != nil else {
guard let mainThreadData else {
fatalError("No main thread flamegraphs generated")
}

Expand Down
Loading