Skip to content

Commit 63eb4a6

Browse files
committed
tests for taskSummary
1 parent ad27de8 commit 63eb4a6

File tree

7 files changed

+12144
-0
lines changed

7 files changed

+12144
-0
lines changed

core/src/test/resources/HistoryServerExpectations/applications/json_expectation

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
[ {
2+
"id" : "local-1427397477963",
3+
"name" : "Spark shell",
4+
"startTime" : "2015-03-26T19:17:57.184GMT",
5+
"endTime" : "2015-03-26T19:20:02.949GMT",
6+
"sparkUser" : "irashid",
7+
"completed" : true
8+
}, {
29
"id" : "local-1426533911241",
310
"name" : "Spark shell",
411
"startTime" : "2015-03-16T19:25:10.242GMT",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"quantiles" : [ 0.05, 0.25, 0.5, 0.75, 0.95 ],
3+
"executorDeserializeTime" : [ 0.0, 0.0, 0.0, 1.0, 3.0 ],
4+
"executorRunTime" : [ 6.0, 6.0, 7.0, 10.0, 48.0 ],
5+
"resultSize" : [ 930.0, 930.0, 930.0, 930.0, 930.0 ],
6+
"jvmGcTime" : [ 0.0, 0.0, 0.0, 0.0, 7.0 ],
7+
"resultSerializationTime" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ],
8+
"memoryBytesSpilled" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ],
9+
"diskBytesSpilled" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ],
10+
"shuffleWriteMetrics" : {
11+
"writeBytes" : [ 9598.0, 9599.0, 9600.0, 9601.0, 9603.0 ],
12+
"writeRecords" : [ 100.0, 100.0, 100.0, 100.0, 100.0 ],
13+
"writeTime" : [ 278805.0, 308809.0, 327953.0, 367487.0, 944783.0 ]
14+
}
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"quantiles" : [ 0.01, 0.5, 0.99 ],
3+
"executorDeserializeTime" : [ 0.0, 0.0, 25.0 ],
4+
"executorRunTime" : [ 5.0, 7.0, 123.0 ],
5+
"resultSize" : [ 930.0, 930.0, 930.0 ],
6+
"jvmGcTime" : [ 0.0, 0.0, 14.0 ],
7+
"resultSerializationTime" : [ 0.0, 0.0, 1.0 ],
8+
"memoryBytesSpilled" : [ 0.0, 0.0, 0.0 ],
9+
"diskBytesSpilled" : [ 0.0, 0.0, 0.0 ],
10+
"shuffleWriteMetrics" : {
11+
"writeBytes" : [ 9597.0, 9600.0, 9614.0 ],
12+
"writeRecords" : [ 100.0, 100.0, 100.0 ],
13+
"writeTime" : [ 260991.0, 327953.0, 8980526.0 ]
14+
}
15+
}

core/src/test/resources/HistoryServerExpectations/applications?minDate=2015-02-10/json_expectation

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
[ {
2+
"id" : "local-1427397477963",
3+
"name" : "Spark shell",
4+
"startTime" : "2015-03-26T19:17:57.184GMT",
5+
"endTime" : "2015-03-26T19:20:02.949GMT",
6+
"sparkUser" : "irashid",
7+
"completed" : true
8+
}, {
29
"id" : "local-1426533911241",
310
"name" : "Spark shell",
411
"startTime" : "2015-03-16T19:25:10.242GMT",

core/src/test/resources/HistoryServerExpectations/applications?status=completed/json_expectation

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
[ {
2+
"id" : "local-1427397477963",
3+
"name" : "Spark shell",
4+
"startTime" : "2015-03-26T19:17:57.184GMT",
5+
"endTime" : "2015-03-26T19:20:02.949GMT",
6+
"sparkUser" : "irashid",
7+
"completed" : true
8+
}, {
29
"id" : "local-1426533911241",
310
"name" : "Spark shell",
411
"startTime" : "2015-03-16T19:25:10.242GMT",

core/src/test/resources/spark-events/local-1427397477963

Lines changed: 12083 additions & 0 deletions
Large diffs are not rendered by default.

core/src/test/scala/org/apache/spark/deploy/history/HistoryServerSuite.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ class HistoryServerSuite extends FunSuite with BeforeAndAfter with Matchers with
8080
"failed stage list json" -> "applications/local-1422981780767/stages?status=failed",
8181
"one stage json" -> "applications/local-1422981780767/stages/1",
8282
"one stage attempt json" -> "applications/local-1422981780767/stages/1/0",
83+
"stage task summary" -> "applications/local-1427397477963/stages/20/0/taskSummary",
84+
"stage task summary w/ custom quantiles" ->
85+
"applications/local-1427397477963/stages/20/0/taskSummary?quantiles=0.01,0.5,0.99",
8386
"stage list with accumulable json" -> "applications/local-1426533911241/stages",
8487
"stage with accumulable json" -> "applications/local-1426533911241/stages/0/0",
8588
"rdd list storage json" -> "applications/local-1422981780767/storage/rdd",
@@ -150,6 +153,13 @@ class HistoryServerSuite extends FunSuite with BeforeAndAfter with Matchers with
150153
badStageId2._1 should be (HttpServletResponse.SC_NOT_FOUND)
151154
// will take some mucking w/ jersey to get a better error msg in this case
152155

156+
157+
val badQuantiles = getContentAndCode(
158+
"applications/local-1427397477963/stages/20/0/taskSummary?quantiles=foo,0.1")
159+
badQuantiles._1 should be (HttpServletResponse.SC_BAD_REQUEST)
160+
badQuantiles._3 should be (Some("Bad value for parameter \"quantiles\". Expected a double, " +
161+
"got \"foo\""))
162+
153163
getContentAndCode("foobar")._1 should be (HttpServletResponse.SC_NOT_FOUND)
154164
}
155165

0 commit comments

Comments
 (0)