servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject [2/2] git commit: SM-2255: Enforce English locale in Stats report
Date Fri, 18 Jul 2014 16:46:47 GMT
SM-2255: Enforce English locale in Stats report


Project: http://git-wip-us.apache.org/repos/asf/servicemix/repo
Commit: http://git-wip-us.apache.org/repos/asf/servicemix/commit/eebcef05
Tree: http://git-wip-us.apache.org/repos/asf/servicemix/tree/eebcef05
Diff: http://git-wip-us.apache.org/repos/asf/servicemix/diff/eebcef05

Branch: refs/heads/servicemix-5.0.x
Commit: eebcef05a6ce4544e1c5abb0e8681cfd6cf4ee01
Parents: 50e411f
Author: Gert Vanthienen <gert.vanthienen@gmail.com>
Authored: Fri Jul 18 18:04:50 2014 +0200
Committer: Gert Vanthienen <gert.vanthienen@gmail.com>
Committed: Fri Jul 18 18:04:50 2014 +0200

----------------------------------------------------------------------
 .../scala/org/apache/servicemix/examples/akka/Stats.scala   | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/servicemix/blob/eebcef05/examples/akka/akka-camel/src/main/scala/org/apache/servicemix/examples/akka/Stats.scala
----------------------------------------------------------------------
diff --git a/examples/akka/akka-camel/src/main/scala/org/apache/servicemix/examples/akka/Stats.scala
b/examples/akka/akka-camel/src/main/scala/org/apache/servicemix/examples/akka/Stats.scala
index 453eeee..fb290b0 100644
--- a/examples/akka/akka-camel/src/main/scala/org/apache/servicemix/examples/akka/Stats.scala
+++ b/examples/akka/akka-camel/src/main/scala/org/apache/servicemix/examples/akka/Stats.scala
@@ -24,7 +24,7 @@ import collection.mutable.Map
 import collection.SortedSet
 import org.apache.servicemix.examples.akka.Stats.Metric
 import java.util.concurrent.atomic.AtomicBoolean
-
+import java.util.Locale
 
 /**
  * A statistics engine that generates basic descriptive statistics (count, average and standard
deviation) for a
@@ -64,9 +64,10 @@ class Stats extends Actor {
       if (changes.getAndSet(false)) {
         val results = SortedSet(metrics.keys.toArray:_*).map { key =>
           val results = metrics(key)
-          "%s,%d,%.4f,%.4f".format(key, results.getOrElse("count", 0),
-                                   results.getOrElse("avg", Double.NaN),
-                                   results.getOrElse("stddev", Double.NaN))
+          "%s,%d,%.4f,%.4f".formatLocal(Locale.ENGLISH, 
+                                        key, results.getOrElse("count", 0),
+                                        results.getOrElse("avg", Double.NaN),
+                                        results.getOrElse("stddev", Double.NaN))
         }
         sender ! ("key,count,average,stddev" +: results.toSeq).mkString(sys.props("line.separator"))
       }


Mime
View raw message