ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [20/50] [abbrv] ignite git commit: ignite-1282 - Benchmarks.
Date Thu, 05 Nov 2015 16:28:40 GMT
ignite-1282 - Benchmarks.


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

Branch: refs/heads/ignite-1753-1282
Commit: f7b308f9a31f19820d95f6276321a5e8d0cab673
Parents: 230a629
Author: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Authored: Thu Nov 5 10:46:02 2015 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Thu Nov 5 10:46:02 2015 +0300

----------------------------------------------------------------------
 .../cache/IgniteSqlQueryPutBenchmark.java       | 26 ++++++++++++++++++++
 1 file changed, 26 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f7b308f9/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteSqlQueryPutBenchmark.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteSqlQueryPutBenchmark.java
b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteSqlQueryPutBenchmark.java
index ea9531a..606c68f 100644
--- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteSqlQueryPutBenchmark.java
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgniteSqlQueryPutBenchmark.java
@@ -24,12 +24,19 @@ import javax.cache.Cache;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.cache.query.SqlQuery;
 import org.apache.ignite.yardstick.cache.model.Person;
+import org.jsr166.LongAdder8;
 import org.yardstickframework.BenchmarkConfiguration;
 
 /**
  * Ignite benchmark that performs put and query operations.
  */
 public class IgniteSqlQueryPutBenchmark extends IgniteCacheAbstractBenchmark {
+    /** */
+    private LongAdder8 resCnt = new LongAdder8();
+
+    /** */
+    private LongAdder8 cnt = new LongAdder8();
+
     /** {@inheritDoc} */
     @Override public void setUp(BenchmarkConfiguration cfg) throws Exception {
         super.setUp(cfg);
@@ -52,7 +59,11 @@ public class IgniteSqlQueryPutBenchmark extends IgniteCacheAbstractBenchmark
{
                 if (p.getSalary() < salary || p.getSalary() > maxSalary)
                     throw new Exception("Invalid person retrieved [min=" + salary + ", max="
+ maxSalary +
                             ", person=" + p + ']');
+
+                resCnt.increment();
             }
+
+            cnt.increment();
         }
         else {
             int i = rnd.nextInt(args.range());
@@ -63,6 +74,21 @@ public class IgniteSqlQueryPutBenchmark extends IgniteCacheAbstractBenchmark
{
         return true;
     }
 
+    /** {@inheritDoc} */
+    @Override public void onWarmupFinished() {
+        super.onWarmupFinished();
+
+        resCnt.reset();
+        cnt.reset();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void tearDown() throws Exception {
+        ignite().log().info("Average number of entries per query: " + (resCnt.longValue()
/ cnt.longValue()));
+
+        super.tearDown();
+    }
+
     /**
      * @param minSalary Min salary.
      * @param maxSalary Max salary.


Mime
View raw message