Github user shubham-pathak22 commented on a diff in the pull request:

    
https://github.com/apache/incubator-apex-malhar/pull/137#discussion_r48222378
  
    --- Diff: library/src/main/java/com/datatorrent/lib/parser/Parser.java ---
    @@ -61,25 +70,48 @@ public void setup(PortContext context)
         }
       };
     
    -  @OutputPortFieldAnnotation(optional = true)
       public transient DefaultOutputPort<INPUT> err = new 
DefaultOutputPort<INPUT>();
    -
    +  public transient DefaultOutputPort<INPUT> validatedOutput = new 
DefaultOutputPort<INPUT>();
       public transient DefaultInputPort<INPUT> in = new 
DefaultInputPort<INPUT>()
       {
         @Override
         public void process(INPUT inputTuple)
         {
    -      Object tuple = convert(inputTuple);
    -      if (tuple == null && err.isConnected()) {
    -        err.emit(inputTuple);
    -        return;
    -      }
    -      if (out.isConnected()) {
    -        out.emit(tuple);
    -      }
    +      incomingTuplesCount++;
    +      processTuple(inputTuple);
         }
       };
     
    +  public void processTuple(INPUT inputTuple)
    +  {
    +    Object tuple = convert(inputTuple);
    +    if (tuple == null && err.isConnected()) {
    +      errorTupleCount++;
    +      err.emit(inputTuple);
    +      return;
    +    }
    +    if (out.isConnected()) {
    +      emittedObjectCount++;
    +      out.emit(tuple);
    +    }
    +  }
    +
    +  @Override
    +  public void beginWindow(long windowId)
    +  {
    +    errorTupleCount = 0;
    +    emittedObjectCount = 0;
    +    rollingPercentValidTuples = 0;
    +    rollingPercentErrorTuples = 0;
    +  }
    +
    +  @Override
    +  public void endWindow()
    +  {
    --- End diff --
    
    Why are we emitting percentage ? AppDataTracker aggregates the counters per 
window basis. On ADT side we have sum/max/avg etc which will not hold true/have 
no meaning w.r.t percentages.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to