[geode] branch develop updated: GEODE-6898: Call benchmark script with --ci option
This is an automated email from the ASF dual-hosted git repository. jbarrett pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new 50db9a9 GEODE-6898: Call benchmark script with --ci option 50db9a9 is described below commit 50db9a9e393418afc4e1a82f43a0be81eae14a70 Author: Kamilla Aslami AuthorDate: Thu Jun 20 16:28:26 2019 -0700 GEODE-6898: Call benchmark script with --ci option Call the benchmark script with the --ci option to indicate to the benchmark that it is being called from CI, so that it will check if the commit should be the new high watermark. --- ci/scripts/run_benchmarks.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/scripts/run_benchmarks.sh b/ci/scripts/run_benchmarks.sh index 3a2cc44..cdb6b7a 100755 --- a/ci/scripts/run_benchmarks.sh +++ b/ci/scripts/run_benchmarks.sh @@ -44,9 +44,9 @@ pushd geode-benchmarks/infrastructure/scripts/aws/ ./launch_cluster.sh -t ${CLUSTER_TAG} -c ${CLUSTER_COUNT} --ci if [ -z "${BASELINE_VERSION}" ]; then - ./run_against_baseline.sh -t ${CLUSTER_TAG} -b ${GEODE_SHA} -B ${BASELINE_BRANCH} -e ${BENCHMARKS_BRANCH} -o ${RESULTS_DIR} -m "'source':'geode-ci','benchmark_branch':'${BENCHMARK_BRANCH}','baseline_branch':'${BASELINE_BRANCH}','geode_branch':'${GEODE_SHA}'" + ./run_against_baseline.sh -t ${CLUSTER_TAG} -b ${GEODE_SHA} -B ${BASELINE_BRANCH} -e ${BENCHMARKS_BRANCH} -o ${RESULTS_DIR} -m "'source':'geode-ci','benchmark_branch':'${BENCHMARK_BRANCH}','baseline_branch':'${BASELINE_BRANCH}','geode_branch':'${GEODE_SHA}'" --ci else - ./run_against_baseline.sh -t ${CLUSTER_TAG} -b ${GEODE_SHA} -V ${BASELINE_VERSION} -e ${BENCHMARKS_BRANCH} -o ${RESULTS_DIR} -m "'source':'geode-ci','benchmark_branch':'${BENCHMARK_BRANCH}','baseline_version':'${BASELINE_VERSION}','geode_branch':'${GEODE_SHA}'" + ./run_against_baseline.sh -t ${CLUSTER_TAG} -b ${GEODE_SHA} -V ${BASELINE_VERSION} -e ${BENCHMARKS_BRANCH} -o ${RESULTS_DIR} -m "'source':'geode-ci','benchmark_branch':'${BENCHMARK_BRANCH}','baseline_version':'${BASELINE_VERSION}','geode_branch':'${GEODE_SHA}'" --ci fi
[geode] branch develop updated: GEODE-6798: Refactoring of client function execution logic (#3710)
This is an automated email from the ASF dual-hosted git repository. jbarrett pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new 18530da GEODE-6798: Refactoring of client function execution logic (#3710) 18530da is described below commit 18530da5ae33fc2c922bb4a2aeb5e00a57eaa31e Author: albertogpz AuthorDate: Sat Jun 22 03:56:19 2019 +0200 GEODE-6798: Refactoring of client function execution logic (#3710) * Some unit tests for the ExecuteRegionFunctionOpImplTest constructors * Do not allocate failedNodes Collection unless necessary --- .../client/internal/ExecuteRegionFunctionOp.java | 335 +++-- .../internal/ExecuteRegionFunctionOpImplTest.java | 128 2 files changed, 233 insertions(+), 230 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/internal/ExecuteRegionFunctionOp.java b/geode-core/src/main/java/org/apache/geode/cache/client/internal/ExecuteRegionFunctionOp.java index 6c95b02..641fd26 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/client/internal/ExecuteRegionFunctionOp.java +++ b/geode-core/src/main/java/org/apache/geode/cache/client/internal/ExecuteRegionFunctionOp.java @@ -18,6 +18,7 @@ package org.apache.geode.cache.client.internal; import static org.apache.geode.internal.cache.execute.AbstractExecution.DEFAULT_CLIENT_FUNCTION_TIMEOUT; import java.util.ArrayList; +import java.util.Collections; import java.util.HashSet; import java.util.Set; @@ -63,49 +64,32 @@ public class ExecuteRegionFunctionOp { // no instances allowed } - /** - * Does a execute Function on a server using connections from the given pool to communicate with - * the server. - * - * @param pool the pool to use to communicate with the server. - * @param region the name of the region to do the put on - * @param function to be executed - * @param serverRegionExecutor which will return argument and filter - * @param resultCollector is used to collect the results from the Server - * @param timeoutMs timeout in milliseconds - */ - public static void execute(ExecutablePool pool, String region, Function function, + private static void execute(ExecutablePool pool, String region, String function, ServerRegionFunctionExecutor serverRegionExecutor, ResultCollector resultCollector, - byte hasResult, int mRetryAttempts, final int timeoutMs) { - -ExecuteRegionFunctionOpImpl op = -new ExecuteRegionFunctionOpImpl(region, function, serverRegionExecutor, -resultCollector, hasResult, new HashSet<>(), timeoutMs); -boolean reexecute = false; -boolean reexecuteForServ = false; -Set failedNodes = new HashSet<>(); -AbstractOp reexecOp; - -int maxRetryAttempts = mRetryAttempts; -if (!function.isHA()) { + byte hasResult, int maxRetryAttempts, boolean isHA, boolean optimizeForWrite, + ExecuteRegionFunctionOpImpl op, boolean isReexecute, Set failedNodes) { + +if (!isHA) { maxRetryAttempts = 0; } do { try { -if (reexecuteForServ) { - reexecOp = new ExecuteRegionFunctionOpImpl(op, +if (isReexecute) { + failedNodes = ensureMutability(failedNodes); + op = new ExecuteRegionFunctionOpImpl(op, (byte) 1/* isReExecute */, failedNodes); - pool.execute(reexecOp, 0); -} else { - pool.execute(op, 0); } -reexecute = false; -reexecuteForServ = false; +pool.execute(op, 0); +return; } catch (InternalFunctionInvocationTargetException e) { -reexecute = true; resultCollector.clearResults(); +if (!isHA) { + return; +} +isReexecute = true; Set failedNodesIds = e.getFailedNodeSet(); +failedNodes = ensureMutability(failedNodes); failedNodes.clear(); if (failedNodesIds != null) { failedNodes.addAll(failedNodesIds); @@ -125,126 +109,68 @@ public class ExecuteRegionFunctionOp { throw se; } -reexecuteForServ = true; +isReexecute = true; resultCollector.clearResults(); +failedNodes = ensureMutability(failedNodes); failedNodes.clear(); } -} while (reexecuteForServ); +} while (true); + } -if (reexecute && function.isHA()) { - ExecuteRegionFunctionOp.reexecute(pool, region, function, serverRegionExecutor, - resultCollector, hasResult, failedNodes, maxRetryAttempts, timeoutMs); + private static Set ensureMutability(final Set failedNodes) { +if (failedNodes == Collections.EMPTY_SET) { + return new HashSet<>(); } +return failedNodes; } - public static void execute(ExecutablePool pool, String region, String function, + /** + * Does a execute Function on a server using
[geode] branch feature/GEODE-6900 updated: GEODE-6900: Add a unit test with detect read conflicts
This is an automated email from the ASF dual-hosted git repository. eshu11 pushed a commit to branch feature/GEODE-6900 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/feature/GEODE-6900 by this push: new 21078b4 GEODE-6900: Add a unit test with detect read conflicts 21078b4 is described below commit 21078b4d184c892a5d3ff70f5b13ba355ee4aa67 Author: eshu AuthorDate: Fri Jun 21 17:29:14 2019 -0700 GEODE-6900: Add a unit test with detect read conflicts --- .../cache/TXDetectReadConflictJUnitTest.java | 108 ++--- 1 file changed, 95 insertions(+), 13 deletions(-) diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/TXDetectReadConflictJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/TXDetectReadConflictJUnitTest.java index 810f148..7d671cb 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/TXDetectReadConflictJUnitTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/TXDetectReadConflictJUnitTest.java @@ -16,9 +16,13 @@ package org.apache.geode.internal.cache; import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS; import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.Assert.assertEquals; import java.util.Properties; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; import org.junit.After; import org.junit.Before; @@ -29,6 +33,7 @@ import org.junit.rules.TestName; import org.apache.geode.cache.Cache; import org.apache.geode.cache.CacheFactory; +import org.apache.geode.cache.CommitConflictException; import org.apache.geode.cache.Region; import org.apache.geode.cache.RegionShortcut; import org.apache.geode.distributed.internal.DistributionConfig; @@ -45,10 +50,17 @@ public class TXDetectReadConflictJUnitTest { @Rule public TestName name = new TestName(); - protected Cache cache = null; - protected Region region = null; - protected Region regionpr = null; - + private Cache cache = null; + private Region region = null; + private Region regionPR = null; + private CountDownLatch allowWriteTransactionToCommitLatch = new CountDownLatch(1); + private CountDownLatch allowReadTransactionToProceedLatch = new CountDownLatch(1); + private final String key = "key"; + private final String key1 = "key1"; + private final String value = "value"; + private final String value1 = "value"; + private final String newValue = "newValue"; + private final String newValue1 = "newValue1"; @Before public void setUp() throws Exception { @@ -69,7 +81,7 @@ public class TXDetectReadConflictJUnitTest { props.put(MCAST_PORT, "0"); props.put(LOCATORS, ""); cache = new CacheFactory(props).create(); -regionpr = cache.createRegionFactory(RegionShortcut.PARTITION).create("testRegionPR"); +regionPR = cache.createRegionFactory(RegionShortcut.PARTITION).create("testRegionPR"); } @After @@ -81,12 +93,12 @@ public class TXDetectReadConflictJUnitTest { public void testReadConflictsRR() throws Exception { cache.close(); createCache(); -region.put("key", "value"); -region.put("key1", "value1"); +region.put(key, value); +region.put(key1, value1); TXManagerImpl mgr = (TXManagerImpl) cache.getCacheTransactionManager(); mgr.begin(); -assertEquals("value", region.get("key")); -assertEquals("value1", region.get("key1")); +assertEquals(value, region.get(key)); +assertEquals(value1, region.get(key1)); mgr.commit(); } @@ -94,12 +106,82 @@ public class TXDetectReadConflictJUnitTest { public void testReadConflictsPR() throws Exception { cache.close(); createCachePR(); -regionpr.put("key", "value"); -regionpr.put("key1", "value1"); +regionPR.put(key, value); +regionPR.put(key1, value1); TXManagerImpl mgr = (TXManagerImpl) cache.getCacheTransactionManager(); mgr.begin(); -assertEquals("value", regionpr.get("key")); -assertEquals("value1", regionpr.get("key1")); +assertEquals(value, regionPR.get(key)); +assertEquals(value1, regionPR.get(key1)); mgr.commit(); } + + @Test + public void readConflictsTransactionCanBlockWriteTransaction() { +cache.close(); +createCache(); + +region.put(key, value); +region.put(key1, value1); +TXManagerImpl txManager = (TXManagerImpl) cache.getCacheTransactionManager(); +txManager.begin(); +assertThat(region.get(key)).isSameAs(value); +region.put(key1, newValue1); +TXState txState = +(TXState) ((TXStateProxyImpl) TXManagerImpl.getCurrentTXState()).getRealDeal(null, null); +txState.setAfterReservation(() ->
[geode] branch feature/GEODE-6900 created (now 12a834e)
This is an automated email from the ASF dual-hosted git repository. eshu11 pushed a change to branch feature/GEODE-6900 in repository https://gitbox.apache.org/repos/asf/geode.git. at 12a834e GEODE-6886: Do not region sync if lost member is an empty accessor (#3721) No new revisions were added by this update.
[geode] branch feature/GEODE-6899 created (now 0011e14)
This is an automated email from the ASF dual-hosted git repository. zhouxj pushed a change to branch feature/GEODE-6899 in repository https://gitbox.apache.org/repos/asf/geode.git. at 0011e14 GEODE-6899: retried client should set last try's version tag if found This branch includes the following new commits: new 0011e14 GEODE-6899: retried client should set last try's version tag if found The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[geode] 01/01: GEODE-6899: retried client should set last try's version tag if found
This is an automated email from the ASF dual-hosted git repository. zhouxj pushed a commit to branch feature/GEODE-6899 in repository https://gitbox.apache.org/repos/asf/geode.git commit 0011e1405caa93c0fafc1a87b15c5fd58679f56d Author: zhouxh AuthorDate: Fri Jun 21 17:14:00 2019 -0700 GEODE-6899: retried client should set last try's version tag if found Co-authored-by: Xiaojian Zhou Co-authored-by: Eric Shu --- .../geode/internal/cache/DistributedRegion.java| 3 +++ .../internal/cache/InitialImageOperation.java | 29 +++--- .../apache/geode/internal/cache/LocalRegion.java | 6 + 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegion.java index 557a999..63929a3 100755 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegion.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegion.java @@ -569,6 +569,9 @@ public class DistributedRegion extends LocalRegion implements InternalDistribute return false; } if (event.getVersionTag() != null && !event.getVersionTag().isGatewayTag()) { + if (logger.isDebugEnabled()) { +logger.debug("Not to create a new version tag for retried event {}", event); + } return false; } if (event.getOperation().isLocal()) { // bug #45402 - localDestroy generated a version tag diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/InitialImageOperation.java b/geode-core/src/main/java/org/apache/geode/internal/cache/InitialImageOperation.java index d0811c3..d2216c0 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/InitialImageOperation.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/InitialImageOperation.java @@ -68,6 +68,7 @@ import org.apache.geode.internal.ByteArrayDataInput; import org.apache.geode.internal.DataSerializableFixedID; import org.apache.geode.internal.InternalDataSerializer; import org.apache.geode.internal.NullDataOutputStream; +import org.apache.geode.internal.SystemTimer; import org.apache.geode.internal.Version; import org.apache.geode.internal.cache.InitialImageFlowControl.FlowControlPermitMessage; import org.apache.geode.internal.cache.entries.DiskEntry; @@ -1885,10 +1886,8 @@ public class InitialImageOperation { if (lostMemberVersionID == null) { lostMemberVersionID = lostMemberID; } - // check to see if the region in this cache needs to synchronize with others - // it is possible that the cache is recover/restart of a member and not - // scheduled to synchronize with others - synchronizeIfNotScheduled(targetRegion, lostMemberID, lostMemberVersionID); + waitInAnotherThreadToCheckIfSynchronizationScheduled(targetRegion, lostMemberID, + lostMemberVersionID); } if (internalAfterSentImageReply != null @@ -1920,11 +1919,33 @@ public class InitialImageOperation { // if region synchronization has not been scheduled or performed, // we do synchronization with no delay as we received the synchronization request // indicating timed task has been triggered on other nodes +if (logger.isDebugEnabled()) { + logger.debug("Newly joined member is triggered to schedule SynchronizeForLostMember"); +} region.scheduleSynchronizeForLostMember(lostMember, lostVersionSource, 0); + } else { +if (logger.isDebugEnabled()) { + logger.debug( + "Live member has been scheduled SynchronizeForLostMember by membership listener."); +} } } /** + * Pause 1 second in anther thread to wait for membership listener to trigger syncWithLostMember + * operation. Otherwise, this is a newly started member, do the syncWithLostMember here. + */ +void waitInAnotherThreadToCheckIfSynchronizationScheduled(DistributedRegion region, +InternalDistributedMember lostMember, VersionSource lostVersionSource) { + region.getCache().getCCPTimer().schedule(new SystemTimer.SystemTimerTask() { +@Override +public void run2() { + synchronizeIfNotScheduled(region, lostMember, lostVersionSource); +} + }, 1000); +} + +/** * Serialize the entries into byte[] chunks, calling proc for each one. proc args: the byte[] * chunk and an int indicating whether it is the last chunk (positive means last chunk, zero * otherwise). The return value of proc indicates whether to continue to the next chunk (true) diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java index dfd2c26..9f34c06
[geode] branch develop updated (304db49 -> 4a3ae76)
This is an automated email from the ASF dual-hosted git repository. nnag pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git. from 304db49 GEODE-6387: Fix compile error in DistributionStats add 4a3ae76 GEODE-6888: Adding ignored exception for ConnectException (#3740) No new revisions were added by this update. Summary of changes: .../geode/internal/cache/ha/HAGIIDUnitTest.java| 35 ++ 1 file changed, 22 insertions(+), 13 deletions(-)
[geode] branch develop updated (7a94527 -> 304db49)
This is an automated email from the ASF dual-hosted git repository. klund pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git. from 7a94527 GEODE-6834: change PartitionedRegionStats to not use deprecated "Int" methods (#3689) add 304db49 GEODE-6387: Fix compile error in DistributionStats No new revisions were added by this update. Summary of changes: .../apache/geode/distributed/internal/DistributionStats.java | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-)
[geode] branch develop updated (964736c -> 7a94527)
This is an automated email from the ASF dual-hosted git repository. dschneider pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git. from 964736c GEODE-6895: Change v2 REST API endpoint to '/management/v2' (#3739) add 7a94527 GEODE-6834: change PartitionedRegionStats to not use deprecated "Int" methods (#3689) No new revisions were added by this update. Summary of changes: .../internal/cache/PartitionedRegionStats.java | 389 +++-- 1 file changed, 195 insertions(+), 194 deletions(-)
[geode] branch develop updated (2df3bdd -> 964736c)
This is an automated email from the ASF dual-hosted git repository. jensdeppe pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git. from 2df3bdd GEODE-6387: Clean up MemberMBeanBridge add 964736c GEODE-6895: Change v2 REST API endpoint to '/management/v2' (#3739) No new revisions were added by this update. Summary of changes: .../management/internal/rest/RegionManagementAcceptanceTest.java | 2 +- .../internal/rest/ClusterManagementLocatorReconnectDunitTest.java | 2 +- .../management/internal/rest/GeodeManagementFeatureFlagDUnitTest.java | 4 ++-- .../geode/management/internal/rest/RegionManagementDunitTest.java | 2 +- .../internal/rest/RegionManagementRestSecurityDUnitTest.java | 2 +- .../apache/geode/management/internal/DisabledClusterConfigTest.java | 2 +- .../internal/rest/SwaggerManagementVerificationIntegrationTest.java | 4 ++-- .../java/org/apache/geode/distributed/internal/InternalLocator.java | 4 ++-- .../management/internal/PlainClusterManagementServiceBuilder.java | 2 +- .../management/client/ClientClusterManagementServiceDUnitTest.java| 2 +- .../org/apache/geode/management/client/ConfigurePDXDUnitTest.java | 2 +- .../geode/management/client/MemberManagementServiceDUnitTest.java | 2 +- .../internal/rest/RegionManagementSecurityRestDUnitTest.java | 2 +- .../management/internal/rest/GatewayManagementIntegrationTest.java| 2 +- .../internal/rest/GeneralManagementServiceRestIntegrationTest.java| 2 +- .../apache/geode/management/internal/rest/JsonSerializationTest.java | 2 +- .../internal/rest/MemberManagementServiceRestIntegrationTest.java | 2 +- .../org/apache/geode/management/internal/rest/PdxManagementTest.java | 2 +- .../management/internal/rest/RegionManagementIntegrationTest.java | 2 +- .../WEB-INF/{geode-management-servlet.xml => management-servlet.xml} | 0 geode-web-management/src/main/webapp/WEB-INF/web.xml | 4 ++-- 21 files changed, 24 insertions(+), 24 deletions(-) rename geode-web-management/src/main/webapp/WEB-INF/{geode-management-servlet.xml => management-servlet.xml} (100%)
[geode] branch develop updated (0b15a81 -> 2df3bdd)
This is an automated email from the ASF dual-hosted git repository. klund pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git. from 0b15a81 GEODE-6889, GEODE-6890: remove sync when updating max stats (#3728) add f354713 GEODE-6387: Rename MemberLevelStatsIntegrationTest add 92e8686 GEODE-6387: Replace CachePerfStats.Clock with LongSupplier add b21b7ef GEODE-6387: Extract MemberLevelStatsTest add 2df3bdd GEODE-6387: Clean up MemberMBeanBridge No new revisions were added by this update. Summary of changes: .../stats/MemberLevelStatsIntegrationTest.java | 69 +- .../bean/stats/MemberLevelStatsJUnitTest.java | 576 --- .../distributed/internal/DistributionStats.java| 95 ++- .../distributed/internal/locks/DLockStats.java | 87 +-- .../geode/internal/cache/CachePerfStats.java | 72 +- .../geode/internal/cache/DiskStoreStats.java | 47 +- .../geode/internal/cache/RegionPerfStats.java | 52 +- .../cache/execute/FunctionServiceStats.java| 22 +- .../internal/statistics/GemFireStatSampler.java| 4 +- .../internal/beans/MemberMBeanBridge.java | 801 +++-- .../geode/internal/cache/CachePerfStatsTest.java | 5 +- .../geode/internal/cache/RegionPerfStatsTest.java | 6 +- .../bean/stats/MemberLevelStatsTest.java | 349 + 13 files changed, 852 insertions(+), 1333 deletions(-) copy geode-junit/src/main/java/org/apache/geode/management/bean/stats/MBeanStatsTestCase.java => geode-core/src/integrationTest/java/org/apache/geode/management/bean/stats/MemberLevelStatsIntegrationTest.java (50%) mode change 100755 => 100644 delete mode 100644 geode-core/src/integrationTest/java/org/apache/geode/management/bean/stats/MemberLevelStatsJUnitTest.java create mode 100644 geode-core/src/test/java/org/apache/geode/management/bean/stats/MemberLevelStatsTest.java
[geode] branch develop updated: GEODE-6889, GEODE-6890: remove sync when updating max stats (#3728)
This is an automated email from the ASF dual-hosted git repository. dschneider pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new 0b15a81 GEODE-6889, GEODE-6890: remove sync when updating max stats (#3728) 0b15a81 is described below commit 0b15a8119b7b42df3b69825f42b9e096556c91a0 Author: Murtuza Boxwala AuthorDate: Fri Jun 21 12:38:15 2019 -0400 GEODE-6889, GEODE-6890: remove sync when updating max stats (#3728) * GEODE-6889: Ensure the highest value is recorded to replyWaitMaxTime * GEODE-6890: Ensure the highest value is recorded to maxSentMessagesTime Co-authored-by: Murtuza Boxwala --- .../distributed/internal/DistributionStats.java| 45 - .../geode/distributed/internal/MaxLongGauge.java | 51 ++ .../internal/DistributionStatsTest.java| 60 .../internal/MaxLongGaugeConcurrentTest.java | 73 ++ .../distributed/internal/MaxLongGaugeTest.java | 105 + 5 files changed, 309 insertions(+), 25 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionStats.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionStats.java index 13a77fb..14e6bae 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionStats.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionStats.java @@ -22,6 +22,7 @@ import org.apache.geode.StatisticsFactory; import org.apache.geode.StatisticsType; import org.apache.geode.StatisticsTypeFactory; import org.apache.geode.annotations.Immutable; +import org.apache.geode.annotations.VisibleForTesting; import org.apache.geode.annotations.internal.MakeNotStatic; import org.apache.geode.internal.NanoTimer; import org.apache.geode.internal.logging.LogService; @@ -48,8 +49,10 @@ public class DistributionStats implements DMStats { private static final int sentMessagesId; private static final int sentCommitMessagesId; private static final int commitWaitsId; - private static final int sentMessagesTimeId; - private static final int sentMessagesMaxTimeId; + @VisibleForTesting + static final int sentMessagesTimeId; + @VisibleForTesting + static final int sentMessagesMaxTimeId; private static final int broadcastMessagesId; private static final int broadcastMessagesTimeId; private static final int receivedMessagesId; @@ -91,9 +94,11 @@ public class DistributionStats implements DMStats { private static final int serialQueueThrottleCountId; private static final int replyWaitsInProgressId; private static final int replyWaitsCompletedId; - private static final int replyWaitTimeId; + @VisibleForTesting + static final int replyWaitTimeId; private static final int replyTimeoutsId; - private static final int replyWaitMaxTimeId; + @VisibleForTesting + static final int replyWaitMaxTimeId; private static final int receiverConnectionsId; private static final int failedAcceptsId; private static final int failedConnectsId; @@ -936,6 +941,9 @@ public class DistributionStats implements DMStats { /** The Statistics object that we delegate most behavior to */ private final Statistics stats; + private final MaxLongGauge maxReplyWaitTime; + private final MaxLongGauge maxSentMessagesTime; + // private final HistogramStats replyHandoffHistogram; // private final HistogramStats replyWaitHistogram; @@ -946,7 +954,7 @@ public class DistributionStats implements DMStats { * factory. */ public DistributionStats(StatisticsFactory f, long statId) { -this.stats = f.createAtomicStatistics(type, "distributionStats", statId); +this(f.createAtomicStatistics(type, "distributionStats", statId)); // this.replyHandoffHistogram = new HistogramStats("ReplyHandOff", "nanoseconds", f, // new long[] {10, 20, 30, 40, 50, 60, 70, 80, 90, 100}, // false); @@ -960,6 +968,8 @@ public class DistributionStats implements DMStats { */ public DistributionStats(Statistics stats) { this.stats = stats; +maxReplyWaitTime = new MaxLongGauge(replyWaitMaxTimeId, stats); +maxSentMessagesTime = new MaxLongGauge(sentMessagesMaxTimeId, stats); // this.replyHandoffHistogram = null; // this.replyWaitHistogram = null; } @@ -1040,22 +1050,12 @@ public class DistributionStats implements DMStats { public void incSentMessagesTime(long nanos) { if (enableClockStats) { this.stats.incLong(sentMessagesTimeId, nanos); - long millis = nanos / 100; - if (getSentMessagesMaxTime() < millis) { -this.stats.setLong(sentMessagesMaxTimeId, millis); - } + long millis = NanoTimer.nanosToMillis(nanos); + maxSentMessagesTime.recordMax(millis); } } /** - * Returns
[geode] branch develop updated (b9168fe -> cb8b36c)
This is an automated email from the ASF dual-hosted git repository. moleske pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git. from b9168fe GEODE-6862: Extract Patterns from LogConsumer add cb8b36c GEODE-6887: Stop routing wrapper meters to int stats (#3733) No new revisions were added by this update. Summary of changes: .../internal/cache/wan/GatewayReceiverStats.java | 4 +- .../statistics/meters/IntStatisticBinding.java | 46 .../statistics/meters/LegacyStatCounter.java | 10 .../cache/wan/GatewayReceiverStatsTest.java| 10 ++-- .../statistics/meters/IntStatisticBindingTest.java | 61 -- .../statistics/meters/LegacyStatCounterTest.java | 29 -- 6 files changed, 7 insertions(+), 153 deletions(-) delete mode 100644 geode-core/src/main/java/org/apache/geode/internal/statistics/meters/IntStatisticBinding.java delete mode 100644 geode-core/src/test/java/org/apache/geode/internal/statistics/meters/IntStatisticBindingTest.java