Skip to content

Commit

Permalink
Minor changes based on Andrew's comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
tdas committed Apr 10, 2014
1 parent fa760fe commit ee6543f
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private[ui] class StreamingPage(parent: StreamingTab)
val headerRow = Seq(
"Receiver",
"Location",
s"Records in last batch",
"Records in last batch",
"Minimum rate\n[records/sec]",
"25th percentile rate\n[records/sec]",
"Median rate\n[records/sec]",
Expand All @@ -102,8 +102,7 @@ private[ui] class StreamingPage(parent: StreamingTab)
}.getOrElse {
Seq(emptyCellTest, emptyCellTest, emptyCellTest, emptyCellTest, emptyCellTest)
}
Seq(receiverName, receiverLocation, receiverLastBatchRecords) ++
receivedRecordStats
Seq(receiverName, receiverLocation, receiverLastBatchRecords) ++ receivedRecordStats
}
Some(listingTable(headerRow, dataRows, fixedWidth = true))
} else {
Expand Down Expand Up @@ -225,15 +224,18 @@ private[ui] class StreamingPage(parent: StreamingTab)
day -> s"$hourString $minuteString $secondString",
week -> s"$dayString $hourString $minuteString",
year -> s"$weekString $dayString $hourString"
).foreach {
case (durationLimit, durationString) if (ms < durationLimit) =>
).foreach { case (durationLimit, durationString) =>
if (ms < durationLimit) {
// if time is less than the limit (upto year)
return durationString
case e: Any => // matcherror is thrown without this
}
}
// if time is more than a year
return s"$yearString $weekString $dayString"
} catch {
case e: Exception =>
logError("Error converting time to string", e)
// if there is some error, return blank string
return ""
}
}
Expand Down

0 comments on commit ee6543f

Please sign in to comment.