Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 47633200AF7 for ; Tue, 14 Jun 2016 19:05:49 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 45EA4160A56; Tue, 14 Jun 2016 17:05:49 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 63F66160A06 for ; Tue, 14 Jun 2016 19:05:48 +0200 (CEST) Received: (qmail 6493 invoked by uid 500); 14 Jun 2016 17:05:47 -0000 Mailing-List: contact commits-help@geode.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.incubator.apache.org Delivered-To: mailing list commits@geode.incubator.apache.org Received: (qmail 6480 invoked by uid 99); 14 Jun 2016 17:05:47 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jun 2016 17:05:47 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 2362B1A0689 for ; Tue, 14 Jun 2016 17:05:47 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.646 X-Spam-Level: X-Spam-Status: No, score=-4.646 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id LSpNH34kXq6H for ; Tue, 14 Jun 2016 17:05:44 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id CBA5C5F257 for ; Tue, 14 Jun 2016 17:05:43 +0000 (UTC) Received: (qmail 6449 invoked by uid 99); 14 Jun 2016 17:05:43 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jun 2016 17:05:43 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id EDAC5DFF13; Tue, 14 Jun 2016 17:05:42 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dschneider@apache.org To: commits@geode.incubator.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: incubator-geode git commit: GEODE-1514: remove RolePerformanceDUnitTest Date: Tue, 14 Jun 2016 17:05:42 +0000 (UTC) archived-at: Tue, 14 Jun 2016 17:05:49 -0000 Repository: incubator-geode Updated Branches: refs/heads/develop de647cd7f -> e84e8855b GEODE-1514: remove RolePerformanceDUnitTest Flaky performance test of deprecated feature Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/e84e8855 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/e84e8855 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/e84e8855 Branch: refs/heads/develop Commit: e84e8855baaf2fbf5756644e7a3b94a28c9dffa1 Parents: de647cd Author: Darrel Schneider Authored: Tue Jun 14 10:03:51 2016 -0700 Committer: Darrel Schneider Committed: Tue Jun 14 10:03:51 2016 -0700 ---------------------------------------------------------------------- .../cache30/RolePerformanceDUnitTest.java | 192 ------------------- 1 file changed, 192 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e84e8855/geode-core/src/test/java/com/gemstone/gemfire/cache30/RolePerformanceDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RolePerformanceDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/cache30/RolePerformanceDUnitTest.java deleted file mode 100644 index 8a82cbe..0000000 --- a/geode-core/src/test/java/com/gemstone/gemfire/cache30/RolePerformanceDUnitTest.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * 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 com.gemstone.gemfire.cache30; - -import static com.gemstone.gemfire.distributed.ConfigurationProperties.*; -import static org.junit.Assert.*; - -import java.util.Properties; - -import org.junit.Test; -import org.junit.experimental.categories.Category; - -import com.gemstone.gemfire.cache.AttributesFactory; -import com.gemstone.gemfire.cache.CacheException; -import com.gemstone.gemfire.cache.DataPolicy; -import com.gemstone.gemfire.cache.Region; -import com.gemstone.gemfire.cache.RegionAttributes; -import com.gemstone.gemfire.cache.Scope; -import com.gemstone.gemfire.test.dunit.Host; -import com.gemstone.gemfire.test.dunit.LogWriterUtils; -import com.gemstone.gemfire.test.dunit.SerializableRunnable; -import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase; -import com.gemstone.gemfire.test.junit.categories.DistributedTest; - -/** - * Tests the performance of Regions when Roles are assigned. - * - * @since GemFire 5.0 - */ -@Category(DistributedTest.class) -public class RolePerformanceDUnitTest extends JUnit4CacheTestCase { - - /** - * Compares times required for series of puts with Roles assigned to - * series of puts with no Roles assigned. Scope is D_ACK. - *

- * Up to 10 attempts will be made before failing. - */ - @Test - public void testRolePerformance() { - int maxAttempts = 10; - for (int i = 1; i <= maxAttempts; i++) { - try { - if (i > 1) { - // clean up from previous run - closeCaches(); - } - doTestRolePerformance(); - break; - } - // only catch assertion failures... - catch (AssertionError e) { - if (i == maxAttempts) { - throw e; - } - else { - LogWriterUtils.getLogWriter().info("testRolePerformance attempt #" + i + - " failed -- reattempting up to 10x", e); - } - } - } - } - - /** - * Implementation of testRolePerformance. - */ - private void doTestRolePerformance() { - final String name = this.getUniqueName(); - - // throw away this run - createConnections(name, false); - createRegions(name); - executeOperations(name); - - closeCaches(); - - // first time with no roles - createConnections(name, false); - createRegions(name); - long millisNoRoles = executeOperations(name); - - closeCaches(); - - // second time with roles - createConnections(name, true); - createRegions(name); - long millisWithRoles = executeOperations(name); - - long deviation = (long)(millisNoRoles * 0.05); // 5% increase is allowed - long ceiling = millisNoRoles + deviation; - - String data = name + " results: millisNoRoles=" + millisNoRoles + - ", millisWithRoles=" + millisWithRoles + ", deviation=" + deviation + - ", ceiling=" + ceiling; - LogWriterUtils.getLogWriter().info(data); - - assertTrue("millisWithRoles is greater than allowable deviation: " + data, - millisWithRoles <= ceiling); - } - - /** - * Create connection to distributed system in all vms and assign one role - * to each if assignRoles is true. - */ - private void createConnections(final String name, final boolean assignRoles) { - final String[][] vmRoles = new String[][] - {{name+"-A"},{name+"-B"},{name+"-C"},{name+"-D"}}; - for (int i = 0; i < vmRoles.length; i++) { - final int vm = i; - Host.getHost(0).getVM(vm).invoke(new SerializableRunnable("Connect") { - public void run() { - Properties config = new Properties(); - if (assignRoles) { - config.setProperty(ROLES, vmRoles[vm][0]); - } - getSystem(config); - } - }); - } - } - - /** - * Close the cache in all vms. - */ - private void closeCaches() { - for (int i = 0; i < Host.getHost(0).getVMCount(); i++) { - final int vm = i; - Host.getHost(0).getVM(vm).invoke(new CacheSerializableRunnable("Close Cache") { - public void run2() throws CacheException { - closeCache(); - } - }); - } - } - - /** - * Create the named root region in all vms. - */ - private void createRegions(final String name) { - for (int i = 0; i < Host.getHost(0).getVMCount(); i++) { - final int vm = i; - Host.getHost(0).getVM(vm).invoke(new CacheSerializableRunnable("Create Region") { - public void run2() throws CacheException { - AttributesFactory fac = new AttributesFactory(); - fac.setScope(Scope.DISTRIBUTED_ACK); - fac.setDataPolicy(DataPolicy.REPLICATE); - RegionAttributes attr = fac.create(); - createRootRegion(name, attr); - } - }); - } - } - - /** - * Execute operations on the named region in one vm. - */ - private long executeOperations(final String name) { - Host.getHost(0).getVM(0).invoke(new CacheSerializableRunnable("Operations") { - public void run2() throws CacheException { - Region region = getRootRegion(name); - long begin = System.currentTimeMillis(); - for (int i = 0; i < 1000; i++) { - region.put("KEY-"+i, "VAL-"+i); - } - long finish = System.currentTimeMillis(); - timing = finish - begin; - } - }); - Long timing = (Long) Host.getHost(0).getVM(0).invoke(() -> RolePerformanceDUnitTest.getTiming()); - return timing.longValue(); - } - protected static transient long timing = -1; - private static Long getTiming() { - return new Long(timing); - } - -} -