-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1eb446d
commit 00ec25c
Showing
9 changed files
with
108 additions
and
23 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
.../src/main/java/com/github/grishberg/profiler/analyzer/AllThreadsMethodsReportGenerator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.github.grishberg.profiler.analyzer | ||
|
||
import com.github.grishberg.profiler.core.AnalyzerResult | ||
import java.io.File | ||
|
||
class AllThreadsMethodsReportGenerator( | ||
private val data: AnalyzerResult, | ||
) : ReportGenerator { | ||
|
||
override fun generate( | ||
file: File, onlyConstructor: Boolean, minimumDurationInMs: Int, packageFilter: String | ||
) { | ||
val baseDir = file.path | ||
|
||
data.threads.forEach { threadItem -> | ||
val profileData = data.data[threadItem.threadId] ?: return | ||
val reportFile = File(baseDir, normalizeFileName(threadItem.name)) | ||
val singleThreadReportGenerator = FlatMethodsReportGenerator(profileData) | ||
singleThreadReportGenerator.generate( | ||
reportFile, onlyConstructor, minimumDurationInMs, packageFilter | ||
) | ||
} | ||
} | ||
|
||
private fun normalizeFileName(threadName: String): String { | ||
return threadName.replace("/", "_").replace("\\", "_").replace(":", "_") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
core/src/main/java/com/github/grishberg/profiler/analyzer/ReportGenerator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
package com.github.grishberg.profiler.analyzer | ||
|
||
import com.github.grishberg.profiler.core.ProfileData | ||
import java.io.File | ||
|
||
interface ReportGenerator { | ||
fun generate(file: File, onlyConstructor: Boolean, minimumDurationInMs: Int, packageFilter: String) | ||
fun generate( | ||
file: File, | ||
onlyConstructor: Boolean, | ||
minimumDurationInMs: Int, | ||
packageFilter: String | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters