Metric on JobManager

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Metric on JobManager

bastien dine
Hello all,

I am using metric to count some sutff in my topology, this is pretty easy with the metric API in getRuntimeContext in a Rich function
However I would like to use this metric API to log start date & end date of my processing, but in the source code executed on the job manager (i.e not in a operator) before & after the env.execute..
How can i retrieve the runtime context, from the execution env maybe ?

Regards,
Bastien

------------------

Bastien DINE
Data Architect / Software Engineer / Sysadmin
bastiendine.io
Reply | Threaded
Open this post in threaded view
|

Re: Metric on JobManager

Jamie Grier-2
What you're describing is not possible.  There is no runtime context or metrics you can use at that point.

The best you can probably do (at least for start time) is just keep a flag in your function and log a metric once and only once when it first starts executing.

On Wed, Nov 21, 2018 at 5:18 AM bastien dine <[hidden email]> wrote:
Hello all,

I am using metric to count some sutff in my topology, this is pretty easy with the metric API in getRuntimeContext in a Rich function
However I would like to use this metric API to log start date & end date of my processing, but in the source code executed on the job manager (i.e not in a operator) before & after the env.execute..
How can i retrieve the runtime context, from the execution env maybe ?

Regards,
Bastien

------------------

Bastien DINE
Data Architect / Software Engineer / Sysadmin
bastiendine.io
Reply | Threaded
Open this post in threaded view
|

Re: Metric on JobManager

bastien dine
Hi Jamie, thanks for your reponse..
Erm this will not be easy.. any idea on how to deal with the end time ?
I can have some Runtime exception in my topology, so i would like to do it like :

try   {
  // Start time here
  env.execute()
} catch (e: Expcetion) {
   
} finally {
   // End time here
}


------------------

Bastien DINE
Data Architect / Software Engineer / Sysadmin
bastiendine.io


Le mer. 21 nov. 2018 à 22:44, Jamie Grier <[hidden email]> a écrit :
What you're describing is not possible.  There is no runtime context or metrics you can use at that point.

The best you can probably do (at least for start time) is just keep a flag in your function and log a metric once and only once when it first starts executing.

On Wed, Nov 21, 2018 at 5:18 AM bastien dine <[hidden email]> wrote:
Hello all,

I am using metric to count some sutff in my topology, this is pretty easy with the metric API in getRuntimeContext in a Rich function
However I would like to use this metric API to log start date & end date of my processing, but in the source code executed on the job manager (i.e not in a operator) before & after the env.execute..
How can i retrieve the runtime context, from the execution env maybe ?

Regards,
Bastien

------------------

Bastien DINE
Data Architect / Software Engineer / Sysadmin
bastiendine.io