git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Metric on JobManager


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 <jgrier@xxxxxxxx> 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 <bastien.dine@xxxxxxxxx> 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