# Progress Indicator on Transform

**URL:** <https://forum.cloverdx.com/t/progress-indicator-on-transform/559>\
**Category:** CloverDX Platform\
**Created:** [July 20, 2009, 12:00am UTC](https://forum.cloverdx.com/t/progress-indicator-on-transform/559 "2009-07-20T00:00:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![deshartman](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.cloverdx.com/deshartman/32/87_2.png) [@deshartman](https://forum.cloverdx.com/u/deshartman)\
**Post date:** [July 20, 2009, 12:00am UTC](https://forum.cloverdx.com/t/progress-indicator-on-transform/559/1 "2009-07-20T00:00:00Z")

</div>

Hi,

I have written a transform that sucks in some Excel data and then transforms it to a database. Question I have is:

Is it possible to somehow provide feedback that can be used to indicate the progress of a particular phase (I have 2)?

My intention is to provide the percentage completion of a phase as a visual progress bar. Two things I would need is the total records being transformed in the phase and then more importantly, the completed records so far. The Console output seems to provide information, but I’m not sure how I can tap into that programatically?

I use the following code to start my ETL jobs:

// Initiate the graph  
EngineInitializer.initGraph(graph, runtimeContext);

Future result;  
try{  
result = runGraph.executeGraph(graph, runtimeContext);  
while (result.isDone()) {;}  
if (!result.get().equals(Result.FINISHED\_OK)){  
System.out.println(“Failed graph execution!\n”);  
return false;  
}  
}catch (Exception e) {  
System.out.println(“Failed graph execution!\n” + e.getMessage());  
return false;  
}

The output is similar to the Console below and I was hoping I could tap into this info in some way:

2009-07-20 19:52:19,150 INFO WatchDog org.jetel.graph.runtime.WatchDog - Sucessfully started all nodes in phase!  
2009-07-20 19:52:24,152 INFO WatchDog Tracking - ---------------------\*\* Start of tracking Log for phase [1] \*\*-------------------  
2009-07-20 19:52:24,152 INFO WatchDog Tracking - Time: 20/07/09 19:52:24  
2009-07-20 19:52:24,152 INFO WatchDog Tracking - Node Status Port #Records #KB Rec/s KB/s  
2009-07-20 19:52:24,153 INFO WatchDog Tracking - ---------------------------------------------------------------------------------  
2009-07-20 19:52:24,155 INFO WatchDog Tracking - DB\_OUTPUT\_TABLE1 RUNNING  
2009-07-20 19:52:24,155 INFO WatchDog Tracking - %cpu:0.03 In:0 736 56 0 0  
2009-07-20 19:52:24,155 INFO WatchDog Tracking - ---------------------------------\*\* End of Log \*\*--------------------------------  
2009-07-20 19:52:29,157 INFO WatchDog Tracking - ---------------------\*\* Start of tracking Log for phase [1] \*\*-------------------  
2009-07-20 19:52:29,157 INFO WatchDog Tracking - Time: 20/07/09 19:52:29  
2009-07-20 19:52:29,157 INFO WatchDog Tracking - Node Status Port #Records #KB Rec/s KB/s  
2009-07-20 19:52:29,157 INFO WatchDog Tracking - ---------------------------------------------------------------------------------  
2009-07-20 19:52:29,157 INFO WatchDog Tracking - DB\_OUTPUT\_TABLE1 RUNNING  
2009-07-20 19:52:29,157 INFO WatchDog Tracking - %cpu:0.04 In:0 2068 158 266 20  
2009-07-20 19:52:29,157 INFO WatchDog Tracking - ---------------------------------\*\* End of Log \*\*--------------------------------  
2009-07-20 19:52:29,296 INFO WatchDog Tracking - ----------------------\*\* Final tracking Log for phase [1] \*\*---------------------  
2009-07-20 19:52:29,296 INFO WatchDog Tracking - Time: 20/07/09 19:52:29  
2009-07-20 19:52:29,296 INFO WatchDog Tracking - Node Status Port #Records #KB Rec/s KB/s  
2009-07-20 19:52:29,296 INFO WatchDog Tracking - ---------------------------------------------------------------------------------  
2009-07-20 19:52:29,296 INFO WatchDog Tracking - DB\_OUTPUT\_TABLE1 FINISHED\_OK  
2009-07-20 19:52:29,296 INFO WatchDog Tracking - %cpu:0.04 In:0 2104 160 0 0  
2009-07-20 19:52:29,296 INFO WatchDog Tracking - ---------------------------------\*\* End of Log \*\*--------------------------------

Thanks  
Des

---

<div class="post-metadata">

**Author:** ![mzatopek](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@mzatopek](https://forum.cloverdx.com/u/mzatopek)\
**Post date:** [July 23, 2009, 7:55am UTC](https://forum.cloverdx.com/t/progress-indicator-on-transform/559/2 "2009-07-23T07:55:03Z")

</div>

Hi,

first of all you shouldn’t use this type of statement

while (result.isDone()) {;}

This is active waiting and really undesirable. Probably it takes most of your processing time. For this purpose, please use

result.get()

This method returns immediately the result of graph is available.

Regarding your question, probably the best starting point for your studying is our class TrackingLogger, which is simple NotificationListener. You can register your own listener and via this object you will be informed about everything what happening in the running graph.

Martin
