Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5D4C611BC3 for ; Mon, 23 Jun 2014 22:14:26 +0000 (UTC) Received: (qmail 75664 invoked by uid 500); 23 Jun 2014 22:14:25 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 75607 invoked by uid 500); 23 Jun 2014 22:14:25 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 75536 invoked by uid 99); 23 Jun 2014 22:14:25 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jun 2014 22:14:25 +0000 Date: Mon, 23 Jun 2014 22:14:25 +0000 (UTC) From: "Benedict (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (CASSANDRA-6591) un-deprecate cache recentHitRate and expose in o.a.c.metrics MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-6591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14041400#comment-14041400 ] Benedict edited comment on CASSANDRA-6591 at 6/23/14 10:12 PM: --------------------------------------------------------------- Apologies for the delay on this. I think this ticket does slightly fit into a wider discussion, though here we're using a Meter instead of a Histogram/Timer (where codahale is much more broken by default). The Meters _are_ still costlier to keep around and maintain than we might otherwise like: each meter maintains a LongAdder (which is in principle to avoid contention, but for our use case just means more cpu-cache misses), but more importantly maintains _four_ LongAdders per meter, so each time we attempt to hit the cache we must update at least 8 LongAdders (since we update two meters here). I would prefer to see us moving to a scheme that uses only two AtomicLong for this data, but I'm not sure we need to hold up this ticket for that. However I would say we only need to maintain _either_ hits _or_ misses, since even for a rate property, misses = total - hits, so we can define our misses as a simple Gauge returning requests - hits was (Author: benedict): Apologies for the delay on this. I think this ticket does slightly fit into a wider discussion, though here we're using a Meter instead of a Histogram/Timer (where codahale is much more broken by default). The Meters *are* still costlier to keep around and maintain than we might otherwise like: each meter maintains a LongAdder (which is in principle to avoid contention, but for our use case just means more cpu-cache misses), but more importantly maintains *four* LongAdders per meter, so each time we attempt to hit the cache we must update at least 8 LongAdders (since we update two meters here). I would prefer to see us moving to a scheme that uses only two AtomicLong for this data, but I'm not sure we need to hold up this ticket for that. However I would say we only need to maintain *either* hits *or* misses, since even for a rate property, misses = total - hits, so we can define our misses as a simple Gauge returning requests - hits > un-deprecate cache recentHitRate and expose in o.a.c.metrics > ------------------------------------------------------------ > > Key: CASSANDRA-6591 > URL: https://issues.apache.org/jira/browse/CASSANDRA-6591 > Project: Cassandra > Issue Type: Improvement > Components: Core > Reporter: Chris Burroughs > Assignee: Chris Burroughs > Priority: Minor > Attachments: j6591-1.2-v1.txt, j6591-1.2-v2.txt, j6591-1.2-v3.txt > > > recentHitRate metrics were not added as part of CASSANDRA-4009 because there is not an obvious way to do it with the Metrics library. Instead hitRate was added as an all time measurement since node restart. > This does allow changes in cache rate (aka production performance problems) to be detected. Ideally there would be 1/5/15 moving averages for the hit rate, but I'm not sure how to calculate that. Instead I propose updating recentHitRate on a fixed interval and exposing that as a Gauge. -- This message was sent by Atlassian JIRA (v6.2#6252)