Skip to content

Commit 78a1a92

Browse files
author
Dragos Manolescu
committed
Added chart title command-line option; updated Spray-Json to 1.2.5
1 parent d109fa8 commit 78a1a92

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ libraryDependencies ++= Seq (
5050
"net.liftweb" %% "lift-json" % "2.5-M4",
5151
"net.minidev" % "json-smart" % "1.1.1",
5252
"com.rojoma" %% "rojoma-json" % "2.2.0",
53-
"io.spray" %% "spray-json" % "1.2.3",
53+
"io.spray" %% "spray-json" % "1.2.5",
5454
"nl.grons" %% "metrics-scala" % "2.2.0",
5555
"fr.janalyse" %% "janalyse-jmx" % "0.6.1" % "compile",
5656
"net.sf.jopt-simple" % "jopt-simple" % "4.4",

src/main/scala/com/microWorkflow/jsonScalaPerftest/Main.scala

+10-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ object Main extends App {
3939
.describedAs("Character; default is 'c'")
4040
.ofType(classOf[String])
4141
.defaultsTo("c")
42+
val chartTitleOpt = argParser
43+
.accepts("title", "Chart title.")
44+
.withRequiredArg()
45+
.describedAs("title")
46+
.ofType(classOf[String])
47+
.defaultsTo("JSON Data set")
4248

4349
val options = try {
4450
argParser.parse(args: _*)
@@ -64,7 +70,10 @@ object Main extends App {
6470
val ms = if (doMap) experiment.measureMapping(iterations) else experiment.measureParsing(iterations)
6571

6672
if (options.has(reportOpt) && options.valueOf[String](reportOpt) == "b") {
67-
val chart = new ChartReporter(if (doMap) "JSON Parsing and Mapping" else "JSON Parsing", ms)
73+
val chart = new ChartReporter(options.valueOf(chartTitleOpt) +
74+
(if (doMap) " (parsing & mapping)" else " (parsing)")
75+
, ms
76+
)
6877
chart.view
6978
System.in.read()
7079
} else {

0 commit comments

Comments
 (0)