ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [18/50] [abbrv] ignite git commit: Added benchmark.
Date Fri, 17 Feb 2017 09:59:28 GMT
Added benchmark.


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

Branch: refs/heads/ignite-1.9
Commit: 7f0af43519f9e27f84ce8106d98b90aff00ee936
Parents: db84b9b
Author: sboikov <sboikov@gridgain.com>
Authored: Mon Jan 23 14:14:22 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Mon Jan 23 14:14:22 2017 +0300

----------------------------------------------------------------------
 .../IgnitePutRandomValueSizeBenchmark.java      | 41 ++++++++++++++++++++
 1 file changed, 41 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7f0af435/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgnitePutRandomValueSizeBenchmark.java
----------------------------------------------------------------------
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgnitePutRandomValueSizeBenchmark.java
b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgnitePutRandomValueSizeBenchmark.java
new file mode 100644
index 0000000..be85b9f
--- /dev/null
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgnitePutRandomValueSizeBenchmark.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.yardstick.cache;
+
+import java.util.Map;
+import org.apache.ignite.IgniteCache;
+
+/**
+ *
+ */
+public class IgnitePutRandomValueSizeBenchmark extends IgniteCacheAbstractBenchmark<Integer,
Object> {
+    /** {@inheritDoc} */
+    @Override public boolean test(Map<Object, Object> ctx) throws Exception {
+        int key = nextRandom(args.range());
+        int size = 64 + nextRandom(64);
+
+        cache.put(key, new byte[size]);
+
+        return true;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected IgniteCache<Integer, Object> cache() {
+        return ignite().cache("atomic-offheap");
+    }
+}


Mime
View raw message