Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 11975 invoked from network); 14 Mar 2011 14:50:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Mar 2011 14:50:18 -0000 Received: (qmail 43174 invoked by uid 500); 14 Mar 2011 14:50:17 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 43120 invoked by uid 500); 14 Mar 2011 14:50:17 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 43112 invoked by uid 99); 14 Mar 2011 14:50:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Mar 2011 14:50:17 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ted.dunning@gmail.com designates 209.85.220.171 as permitted sender) Received: from [209.85.220.171] (HELO mail-vx0-f171.google.com) (209.85.220.171) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Mar 2011 14:50:09 +0000 Received: by vxc40 with SMTP id 40so4848041vxc.30 for ; Mon, 14 Mar 2011 07:49:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=PFomhiwo62NkJFnmfHlx38SK9q8LYzGdhCcwmTDVmkw=; b=W1ETEUlF9jMZiTtY6cI6fgv91ZD3w3/dSd3yAn14zOgILe+/UnyIAzWyykVRu9lUeb cKZNnlzVb22RJljuso8AOIf+DRLZalST79WmOZkaTOvSTOB+qwbWsBn2SH/I/ddJLAfX vce64yQYzrKb/W/zE6rcV94BzCU0WLMUuFK4M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=muGrsbRASdxIp+4lXJeEqskLOXDuacIBKbyGeqgwE7u8YvoiYk9UmBbbpS0BacWhrA UifLLtfr+cMvwCXjin98wMdNkKdtqcJA49SmOZWUFJA5UVBNzbt0Q87syeGErmtPKGjC XuyQrCSSLYSVHWEY1rUNYOV5+p1H4j3+JVL6I= Received: by 10.52.0.37 with SMTP id 5mr832374vdb.269.1300114183862; Mon, 14 Mar 2011 07:49:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.167.37 with HTTP; Mon, 14 Mar 2011 07:49:15 -0700 (PDT) In-Reply-To: References: From: Ted Dunning Date: Mon, 14 Mar 2011 07:49:15 -0700 Message-ID: Subject: Re: running average of a rate To: Commons Users List Cc: Benson Margulies Content-Type: multipart/alternative; boundary=20cf3054aa3318b942049e726ccb X-Virus-Checked: Checked by ClamAV on apache.org --20cf3054aa3318b942049e726ccb Content-Type: text/plain; charset=UTF-8 For the overall average you need is the total time and total characters. Do the division at presentation time. If you want a decaying moving average, then a variant on Welford's method is useful for an on-line estimate. I just had such a discussion in the hbase group. For that you need state, however, and atomic updates. A useful approximation might be possible if you can report many moving averages which can themselves be averaged. Can you say a bit more about your context? Is this in hadoop? Did you want to maintain the average across the cluster? Did you want real averages or a moving average? Do you have constant sampling rate? On Mon, Mar 14, 2011 at 7:33 AM, Benson Margulies wrote: > Please excuse the following ignorant question. > > I want to maintain summary statistics of a rate. At each 'event', I > know the number of characters and the time it took to process them, > and I want to maintain summary statistics for the rate of > chars/second. I imagine that I'm missing something basic, but I don't > see how to do this. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > For additional commands, e-mail: user-help@commons.apache.org > > --20cf3054aa3318b942049e726ccb--