Skip to content

Commit

Permalink
Adding some output
Browse files Browse the repository at this point in the history
  • Loading branch information
wardbekker committed Mar 20, 2017
1 parent 5440c43 commit 1f6e219
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
6 changes: 6 additions & 0 deletions benchmark2.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
<component name="NewModuleRootManager" inherit-compiler-output="false">
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
13 changes: 4 additions & 9 deletions src/main/scala/org/ward/Benchmark.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ object Benchmark {

val fs = FileSystem.get(new Configuration(true))

//make sure dir is empty
fs.delete(new Path(outputTempPath), true)

val a = sc.parallelize(1 until nFiles + 1, nFiles)

Expand All @@ -48,21 +46,18 @@ object Benchmark {
var totalTimeW = 0L

for (i <- 1 to repeat) {
//make sure dir is empty
fs.delete(new Path(outputTempPath), true)

val (junk, timeW) = profile {
b.saveAsTextFile(outputTempPath)
}

log.info("\nABenchmark: Pass " + i + " Aggregate Throughput : " + (nFiles * fSize.toLong)/(timeW/1000.toFloat) + " Bytes per second")

totalTimeW += timeW

fs.delete(new Path(outputTempPath), true)

}

//make sure dir is empty
fs.delete(new Path(outputTempPath), true)


log.info("\n\nBenchmark: Total volume : " + (repeat * nFiles.toLong * fSize) + " Bytes")
log.info("\nBenchmark: Total write time : " + (totalTimeW/1000.toFloat) + " s")
log.info("\nABenchmark: Aggregate Throughput : " + (repeat * nFiles * fSize.toLong)/(totalTimeW/1000.toFloat) + " Bytes per second\n")
Expand Down

0 comments on commit 1f6e219

Please sign in to comment.