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 3638A200D44 for ; Mon, 20 Nov 2017 17:02:06 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 34EA1160BEC; Mon, 20 Nov 2017 16:02:06 +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 7AE97160BF9 for ; Mon, 20 Nov 2017 17:02:05 +0100 (CET) Received: (qmail 59218 invoked by uid 500); 20 Nov 2017 16:02:04 -0000 Mailing-List: contact issues-help@geode.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.apache.org Delivered-To: mailing list issues@geode.apache.org Received: (qmail 59209 invoked by uid 99); 20 Nov 2017 16:02:04 -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; Mon, 20 Nov 2017 16:02:04 +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 BC3021A2257 for ; Mon, 20 Nov 2017 16:02:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] 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 3MR7H3dJTksv for ; Mon, 20 Nov 2017 16:02:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id EB33060E3F for ; Mon, 20 Nov 2017 16:02:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 24A77E0EEF for ; Mon, 20 Nov 2017 16:02:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 812AB240E2 for ; Mon, 20 Nov 2017 16:02:00 +0000 (UTC) Date: Mon, 20 Nov 2017 16:02:00 +0000 (UTC) From: "ASF subversion and git services (JIRA)" To: issues@geode.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (GEODE-2676) RegionMBean statistics wrong on partitioned regions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 20 Nov 2017 16:02:06 -0000 [ https://issues.apache.org/jira/browse/GEODE-2676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16259406#comment-16259406 ] ASF subversion and git services commented on GEODE-2676: -------------------------------------------------------- Commit 3a3935f8d11a3c6b75815781f6cd551584613425 in geode's branch refs/heads/develop from [~jinmeiliao] [ https://gitbox.apache.org/repos/asf?p=geode.git;h=3a3935f ] GEODE-2676: fix NPE with ShowMetricsCommand. > RegionMBean statistics wrong on partitioned regions > --------------------------------------------------- > > Key: GEODE-2676 > URL: https://issues.apache.org/jira/browse/GEODE-2676 > Project: Geode > Issue Type: Bug > Components: management > Reporter: Fred Krone > Priority: Minor > Labels: jmx > > RegionMBean attributes hitCount, hitRatio, missCount, lastAccessedTime, and lastModifiedTime will always be 0 for an mbean that represents an partitioned region. > The gettors for these methods may call getStatistics() which on a PR always throws UnsupportedOperationException. So this exception might even get exposed to customers. > The initialization of RegionMBeanBridge calls getStatisticsEnabled() which returns true on a PartitionedRegion. This does have meaning on a PR but it does not mean that getStatistics() is a supported operation. On a PR setting statistics-enabled causes each region-entry to also keep track of its last access time. > It is true that if getStatisticsEnabled() is false then you should not call getStatistics. But the opposite is not true. Since we currently have regions that do not support getStatistics(), the code in RegionMBeanBridge should catch UnsupportedOperationException and handle it. I would suggest that the constructor be changed that initializes the "isStatisticsEnabled" field. Instead of only calling getStatisticsEnabled() it should also call getStatistics(). Something like this: > {noformat} > { > boolean useGetStatistics = regAttrs.getStatisticsEnabled(); > if (useGetStatistics) { > try { > region.getStatistics(); > } catch (UnsupportedOperationException ex) { > useGetStatistics = false; > } > } > this.isStatisticsEnabled = useGetStatistics; > } > {noformat} > That way in a future release if PRs are changed to support getStatistics this code will start calling it without having a direct dependency on the implementation of PartitionedRegion. > https://issues.apache.org/jira/browse/GEODE-2685 is a request to support getStatistics on PRs. -- This message was sent by Atlassian JIRA (v6.4.14#64029)