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 40651200D11 for ; Mon, 18 Sep 2017 04:27:35 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 3EE2D1609D9; Mon, 18 Sep 2017 02:27:35 +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 360371609D8 for ; Mon, 18 Sep 2017 04:27:34 +0200 (CEST) Received: (qmail 79555 invoked by uid 500); 18 Sep 2017 02:27:33 -0000 Mailing-List: contact user-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list user@flink.apache.org Received: (qmail 79545 invoked by uid 99); 18 Sep 2017 02:27:32 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Sep 2017 02:27:32 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 78CBDC510D for ; Mon, 18 Sep 2017 02:27:32 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.901 X-Spam-Level: X-Spam-Status: No, score=-0.901 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.8, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id pLG6akkrvy_O for ; Mon, 18 Sep 2017 02:27:31 +0000 (UTC) Received: from mail-pf0-f176.google.com (mail-pf0-f176.google.com [209.85.192.176]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 9E3BB5F397 for ; Mon, 18 Sep 2017 02:27:30 +0000 (UTC) Received: by mail-pf0-f176.google.com with SMTP id m63so4069187pfk.7 for ; Sun, 17 Sep 2017 19:27:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=Fyc1+mrca0KX4NmmVsraG/c8w0DtJNHq3BWK74NsKDg=; b=lic85bCUxF3ZYLLbPKqweaW9+NC7isv+XqR3h+1269g8vqmpBF2hXTknpBgyFjqkvh pbKDQwokL4Fv/z00ebosxCUoOOCg+0TnCMNNjuuQ5m/phWvb2/a96JMHZIneuMv28znX tTC+UqIO2EN/gLZ0V5W2TmPZvRafFua4p2jSvIlYT3XQBb7tOulnI6AnAG9pOXSWYqP2 s2mvM0wDGfJxTPoFGXrOe0tl0S4ILzgvdFFp0/Lk6wXHaOELK9xcqWztj5l8S/xcR4Cv Av12EFHAFn9CY9dQkflb7QTIcmTTSx93XyY4C0wUEUfexDV5UHD0OWLMX0dwb/+gQDHs 6SIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Fyc1+mrca0KX4NmmVsraG/c8w0DtJNHq3BWK74NsKDg=; b=WQgxE43op3zsZt6C2nelvOQPSyf/f2Bpe/RL2cy8sGoOTplaTNj2BP/UPl8rEOeut6 7fCFGasuxm0+tFXBGv03+pnzz3+7QgzYKY8lxIVy1jflH1mdBR7szVRdCwDpj3XEeOw0 HzTmWY4qsPAY9b/eFNsH2Gl71evVLQJCCa5WeGAxyblFAjut07nTZsTzf10Xl7FhFduc h2fIUvPBB5QUNf6/cMJhY5XRqKMSLCjW35SonHO2+8/PLqvFwHT2eEe6VL+ANfq9ltre h8M1NfWDOx0L4+bUD/tr+lpghopoq8BuRM6IfCni2z4lbqjKeNcgAZExKi508lDbtQUq QufA== X-Gm-Message-State: AHPjjUi8ZM5rNVrNVI7zmjfZ2sTOj2NWJPowBVkhnGFnCXBvr/IF8YAw vxewRw0Wt+af7fo1f6dm/bCpiUWk+4JkJfHF4jSVbxIp X-Google-Smtp-Source: ADKCNb5FH4Mz/bJm8CQvXwYD18B8vCKVR85SyU1UNy4TVK2Fk2GV+iPR2ugUN23VyKQFmZ3HTjfO3iNaeKfk119XKSE= X-Received: by 10.101.70.203 with SMTP id n11mr30589379pgr.197.1505701649077; Sun, 17 Sep 2017 19:27:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.145.23 with HTTP; Sun, 17 Sep 2017 19:27:28 -0700 (PDT) From: Jiewen Shao Date: Sun, 17 Sep 2017 19:27:28 -0700 Message-ID: Subject: need instruction on how the Flink metric works To: user@flink.apache.org Content-Type: multipart/alternative; boundary="089e08233c08ee595605596d7bc0" archived-at: Mon, 18 Sep 2017 02:27:35 -0000 --089e08233c08ee595605596d7bc0 Content-Type: text/plain; charset="UTF-8" I'm new to flink and I have read https://ci.apache.org/projects/flink/flink-docs-release-1.3/monitoring/metrics.html, I am still unclear where do I read the metrics I added. for example, public static void main(String[] args) throws Exception { StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); env.setParallelism(2); List wordList = Arrays.asList("Hive", "Presto", "Impala", "Parquet","ORC","Hadoop", "Flink", "Spark", "Storm", "Tez", "Flink"); DataStreamSource source = env.fromCollection(wordList); DataStream> dataStream = env.fromCollection( wordList).map(new WordLengthCounter()); dataStream.print(); env.execute(); } and public class WordLengthCounter extends RichMapFunction> { private static final long serialVersionUID = 1L; private Counter counter; @Override public void open(Configuration config) { this.counter = getRuntimeContext() .getMetricGroup() .counter("myCounter"); } @Override public Tuple2 map(String value) throws Exception { this.counter.inc(); return new Tuple2(value, value.length()); } } Now, where do I see the counter? Sorry for the naive question can anyone point me to any good end-to-end "hello world" example for flink metrics. --089e08233c08ee595605596d7bc0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I'm new to flink and I have read=C2=A0https://ci.apache.org/projects/flink/flink-docs-release-1.3/monitoring= /metrics.html, I am still unclear where do I read the metrics I added.= =C2=A0

for example,=C2=A0

public static void ma= in(String[] args) throws Exception {

<= br>

=C2=A0 =C2=A0 =C2=A0 =C2=A0 StreamExecutionEnvironment env =3D StreamExecutionEnvironment.getExecutio= nEnvironment();

=C2=A0 =C2=A0 =C2=A0 =C2=A0 env.setParallelism(2);

=C2=A0 =C2=A0 =C2=A0= =C2=A0

=C2=A0 =C2= =A0 =C2=A0 =C2=A0 List<String> wordList =3D Arrays.asList("Hive", "Presto= ", "Impala", "Parquet","ORC",&= quot;Hadoop", "Flink"= ;, "Spark", "Storm", "Tez", "F= link"); =C2=A0 =C2=A0 =C2=A0 =C2=A0

=C2=A0 =C2=A0 =C2=A0 =C2=A0 DataStreamSource<String> source =3D env.fromCollection(wordList);

=C2=A0 =C2=A0 =C2=A0 =C2=A0 DataStre= am<Tuple2<String, Integer>> dataStream =3D env.fro= mCollection(wordList).map(new WordLengthCounter());

=C2=A0 = =C2=A0 =C2=A0 =C2=A0 dataStream= .print();

=C2=A0 =C2=A0 =C2=A0 =C2=A0 env.execute();

=C2=A0 =C2=A0 }


and=C2=A0


public cl= ass WordLengthCounter extends<= /span> RichMapFunction<String, Tuple2<String, Integer>> {


private static final long serialVersionUID =3D 1L;

private Counter counter;


@Override

=C2=A0= public void open(Configuration config) {

=C2=A0 =C2=A0 this.counter =3D ge= tRuntimeContext()

=C2=A0 =C2=A0 =C2=A0 .getMetricGroup()

=C2=A0 =C2=A0 = =C2=A0 .counter("myCounter"<= /span>);

=C2=A0 }


@Override

public Tuple2<String, Integer> map= (String value) throws Exception {

this.counter= .inc();

return new Tuple2<String, Integer>(value, value.length());

}

}



Now, where do I see the counter? Sorr= y for the naive question


can anyone point= me to any good end-to-end "hello world" example for flink metric= s.
--089e08233c08ee595605596d7bc0--