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 32F94200D5F for ; Mon, 18 Dec 2017 09:50:04 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 316CF160BF9; Mon, 18 Dec 2017 08:50:04 +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 79CB1160C05 for ; Mon, 18 Dec 2017 09:50:03 +0100 (CET) Received: (qmail 608 invoked by uid 500); 18 Dec 2017 08:50:02 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 597 invoked by uid 99); 18 Dec 2017 08:50:02 -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, 18 Dec 2017 08:50:02 +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 14E4D1A0B30 for ; Mon, 18 Dec 2017 08:50:02 +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, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id Zftl9Re5BnWm for ; Mon, 18 Dec 2017 08:50:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id EB5C55F30C for ; Mon, 18 Dec 2017 08:50:00 +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 79057E0AA3 for ; Mon, 18 Dec 2017 08:50:00 +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 29DF0240DE for ; Mon, 18 Dec 2017 08:50:00 +0000 (UTC) Date: Mon, 18 Dec 2017 08:50:00 +0000 (UTC) From: "Reid Chan (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (HBASE-19450) Add log about average execution time for ScheduledChore MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 18 Dec 2017 08:50:04 -0000 [ https://issues.apache.org/jira/browse/HBASE-19450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16294478#comment-16294478 ] Reid Chan edited comment on HBASE-19450 at 12/18/17 8:49 AM: ------------------------------------------------------------- This is a trivial patch, on purpose to provide a util to measure avg elapsed time for a specific method. It can be used in DEBUG or INFO, depending on cases. What's more, by providing elapsed time, bq. will be more helpful to indicate potential issues. Differences between MovingAverage are about, # measuring last N or overall # applying different weights to different data at different positions. Usage is simple: {code} // chore() return void, so type is void. MovingAverage timeMeasurement = new WindowMovingAverage(); timeMeasurement.measure(() -> { chore(); return null; }); LOG.info(String.format("%s average execution time: %.2f ns.", getName(), timeMeasurement.getAverageTime())); {code} was (Author: reidchan): This is a trivial patch, on purpose to provide a util to measure avg elapsed time for a specific method. It can be used in DEBUG or INFO, depending on cases. What's more, by providing elapsed time, bq. will be more helpful to indicate potential issues. Differences between MovingAverage are about, # measuring last N or overall # applying different weights to different data at different positions. Usage is simple: {code} timeMeasurement.measure(() -> { chore(); return null; }); LOG.info(String.format("%s average execution time: %.2f ns.", getName(), timeMeasurement.getAverageTime())); {code} > Add log about average execution time for ScheduledChore > ------------------------------------------------------- > > Key: HBASE-19450 > URL: https://issues.apache.org/jira/browse/HBASE-19450 > Project: HBase > Issue Type: Improvement > Reporter: Reid Chan > Assignee: Reid Chan > Priority: Minor > Attachments: HBASE-19450.master.001.patch, HBASE-19450.master.002.patch, HBASE-19450.master.003.patch, HBASE-19450.master.004.patch > > > So far, there is no information about the exact execution time for a chore, we can provide log information about it. It also brings other benefits, like discovering inefficient chores which show rooms for improvement. -- This message was sent by Atlassian JIRA (v6.4.14#64029)