Re: Re: How to dynamically initialize flink metrics in invoke method and then reuse it?

2020-07-02 Thread Xintong Song
; -- > wangl...@geekplus.com.cn > > *Sender:* Xintong Song > *Send Time:* 2020-07-03 13:14 > *Receiver:* wangl...@geekplus.com.cn > *cc:* user > *Subject:* Re: How to dynamically initialize flink metrics in invoke > method and then reuse it? >

Re: Re: How to dynamically initialize flink metrics in invoke method and then reuse it?

2020-07-02 Thread wangl...@geekplus.com.cn
wangl...@geekplus.com.cn Send Time: 2020-07-03 14:27 Receiver: Xintong Song cc: user Subject: Re: Re: How to dynamically initialize flink metrics in invoke method and then reuse it? Hi Xintong, Yes, initializing the metric in the `open` method works, but it doesn't solve my problem. I want to init

Re: Re: How to dynamically initialize flink metrics in invoke method and then reuse it?

2020-07-02 Thread wangl...@geekplus.com.cn
inlog info. I want to monitor the qps by tableName. The tableName is different for every record. Thanks, Lei wangl...@geekplus.com.cn Sender: Xintong Song Send Time: 2020-07-03 13:14 Receiver: wangl...@geekplus.com.cn cc: user Subject: Re: How to dynamically initialize flink metrics in i

Re: How to dynamically initialize flink metrics in invoke method and then reuse it?

2020-07-02 Thread Xintong Song
Hi Lei, I think you should initialize the metric in the `open` method. Then you can save the initialized metric as a class field, and update it in the `invoke` method for each record. Thank you~ Xintong Song On Fri, Jul 3, 2020 at 11:50 AM wangl...@geekplus.com.cn < wangl...@geekplus.com.cn>

How to dynamically initialize flink metrics in invoke method and then reuse it?

2020-07-02 Thread wangl...@geekplus.com.cn
In one flink operator, i want to initialize multiple flink metrics according to message content. As the code below. public void invoke(ObjectNode node, Context context) throws Exception { String tableName = node.get("metadata").get("topic").asText(); Meter meter = getRuntimeContext().g