Return-Path: Delivered-To: apmail-hadoop-common-user-archive@www.apache.org Received: (qmail 82686 invoked from network); 23 Jan 2011 03:00:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Jan 2011 03:00:18 -0000 Received: (qmail 56174 invoked by uid 500); 23 Jan 2011 03:00:15 -0000 Delivered-To: apmail-hadoop-common-user-archive@hadoop.apache.org Received: (qmail 55970 invoked by uid 500); 23 Jan 2011 03:00:14 -0000 Mailing-List: contact common-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-user@hadoop.apache.org Delivered-To: mailing list common-user@hadoop.apache.org Received: (qmail 55962 invoked by uid 99); 23 Jan 2011 03:00:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 23 Jan 2011 03:00:13 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of yuzhihong@gmail.com designates 209.85.161.48 as permitted sender) Received: from [209.85.161.48] (HELO mail-fx0-f48.google.com) (209.85.161.48) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 23 Jan 2011 03:00:07 +0000 Received: by fxm2 with SMTP id 2so3412083fxm.35 for ; Sat, 22 Jan 2011 18:59:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=rgV0/j5g31vju8nz93hR3+VLktaoPhLC+owPdxnfIZc=; b=rxeWGjw9/e/wXTDei+UHkUufhu0cu7G08T32fnOz5dIVLQi0Crt5r5llxsC+iZD6Xw s9e5z4L5Mm6Add6MY4EPdotpdqk6VGXwlga2nAPwwmBTBjbR2z3eecr15Y6r65uQFlMz IcR95fB7svtDC1SQtfgRew0fDulr2q9BzgTEs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=eXijWt7HJWfft/Pi7alFwX/Dl/zlLnlWi4ibgF6TPCwRj4CrrWhTTNLxJp9JbYBoQt FxatNh4f4+uAifkTpSMQnojASTpOZLiceM0SW/7d+s3r9V1jxqPIGOSU0ZpBx4R5eOe5 ciH1FLCbWjT3d2vl7SJfJdzlUpxEtfcH8arSM= MIME-Version: 1.0 Received: by 10.223.74.5 with SMTP id s5mr2539633faj.72.1295751586044; Sat, 22 Jan 2011 18:59:46 -0800 (PST) Received: by 10.223.78.140 with HTTP; Sat, 22 Jan 2011 18:59:45 -0800 (PST) In-Reply-To: References: Date: Sat, 22 Jan 2011 18:59:45 -0800 Message-ID: Subject: Re: How to get metrics information? From: Ted Yu To: common-user@hadoop.apache.org Content-Type: multipart/alternative; boundary=20cf3054a38f00da2f049a7aadef --20cf3054a38f00da2f049a7aadef Content-Type: text/plain; charset=ISO-8859-1 In the test code, JobTracker is returned from: mr = new MiniMRCluster(0, 0, 0, "file:///", 1, null, null, null, conf); jobTracker = mr.getJobTrackerRunner().getJobTracker(); I guess it is not exposed in non-test code. On Sat, Jan 22, 2011 at 6:38 PM, Zhenhua Guo wrote: > Thanks! > How to get JobTracker object? > > Gerald > > On Sun, Jan 23, 2011 at 5:46 AM, Ted Yu wrote: > > You can use the following code: > > JobClient jc = new JobClient(jobConf); > > int numReduces = jc.getClusterStatus().getMaxReduceTasks(); > > > > For 0.20.3, you can use: > > ClusterMetrics metrics = jobTracker.getClusterMetrics(); > > > > On Sat, Jan 22, 2011 at 9:57 AM, Zhenhua Guo wrote: > > > >> I want to get metrics information (e.g. number of Maps, number of > >> Reduces, memory use, load) by APIs. I found two useful classes - > >> ClusterStatus and ClusterMetrics. My question is how I can get > >> instances of that two classes? From JobClient or JobTracker? Any > >> suggested alternative way to get the information? > >> > >> Thanks > >> > >> Gerald > >> > > > --20cf3054a38f00da2f049a7aadef--