Skip to content

Commit

Permalink
Qualification/Profiling tool add tests for Spark2 event logs (#2843)
Browse files Browse the repository at this point in the history
* add qualification test for spark2

* Update readme
  • Loading branch information
tgravescs authored Jul 7, 2021
1 parent 91b9a12 commit d9f477c
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ GPU generated event logs.
- Spark 3.0.1 or newer, the Qualification tool just needs the Spark jars and the Profiling tool
runs a Spark application so needs the Spark runtime.
- Java 8 or above
- Complete Spark event log(s) from Spark 3.0 or above version.
- Spark event log(s) from Spark 2.0 or above version.
Support both rolled and compressed event logs with `.lz4`, `.lzf`, `.snappy` and `.zstd` suffixes.
Also support Databricks specific rolled and compressed(.gz) eventlogs.
The tool does not support nested directories, event log files or event log directories should be
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
App Name,App ID,Score,Potential Problems,SQL Dataframe Duration,App Duration,Executor CPU Time Percent,App Duration Estimated,SQL Duration with Potential Problems,SQL Ids with Failures
Spark shell,local-1624892957956,21.07,"",3751,17801,58.47,false,0,""
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,18 @@ class ApplicationInfoSuite extends FunSuite with Logging {
}
}

test("test spark2 eventlog") {
val eventLog = Array(s"$logDir/spark2-eventlog.zstd")
val apps = ToolTestUtils.processProfileApps(eventLog, sparkSession)
assert(apps.size == 1)
assert(apps.head.sparkVersion.equals("2.2.3"))
assert(apps.head.gpuMode.equals(false))
assert(apps.head.jobStart.size == 1)
assert(apps.head.jobStart.head.jobID.equals(0))
val stage0 = apps.head.stageSubmitted.filter(_.stageId == 0)
assert(stage0.head.numTasks.equals(6))
}

test("malformed json eventlog") {
val eventLog = s"$logDir/malformed_json_eventlog.zstd"
TrampolineUtil.withTempDir { tempDir =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ class QualificationSuite extends FunSuite with BeforeAndAfterEach with Logging {
runQualificationTest(logFiles, "nds_q86_test_expectation.csv")
}

test("spark2 eventlog") {
val profileLogDir = ToolTestUtils.getTestResourcePath("spark-events-profiling")
val log = s"$profileLogDir/spark2-eventlog.zstd"
runQualificationTest(Array(log), "spark2_expectation.csv")
}

test("test udf event logs") {
val logFiles = Array(
s"$logDir/dataset_eventlog",
Expand Down

0 comments on commit d9f477c

Please sign in to comment.