[ 
https://issues.apache.org/jira/browse/GOBBLIN-1764?focusedWorklogId=839167&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-839167
 ]

ASF GitHub Bot logged work on GOBBLIN-1764:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 13/Jan/23 22:37
            Start Date: 13/Jan/23 22:37
    Worklog Time Spent: 10m 
      Work Description: phet commented on code in PR #3623:
URL: https://github.com/apache/gobblin/pull/3623#discussion_r1070071056


##########
gobblin-modules/gobblin-kafka-09/src/test/java/org/apache/gobblin/runtime/KafkaAvroJobStatusMonitorTest.java:
##########
@@ -89,6 +97,7 @@ public class KafkaAvroJobStatusMonitorTest {
   private String stateStoreDir = "/tmp/jobStatusMonitor/statestore";
   private MetricContext context;
   private KafkaAvroEventKeyValueReporter.Builder<?> builder;
+  private static Queue<GaaSObservabilityEventExperimental> queue = new 
LinkedList<>();

Review Comment:
   took me a minute to see how this gets wired in so that the events arrive on 
it... now I found the static inner class.  this strikes me as brittle, esp. 
with `queue` being `static` and shared between all instances.  still I 
understand the difficulty you face when the system under test internally 
instantiates its own `MockGaaSObservabilityEventProducer` from a class name.  
hence, I'd accept those downsides, and just concentrate on readability.
   
   either add a clearer comment up here saying it will be used in this 
unconventional way, for the benefit of testing.  or my own pref might be to 
create a small singleton, known to both this test class and the mock, which 
documents the arrangement, while encapsulating the queue. 
   e.g.:
   ```
   /** why this odd arrangement ... */
   static class QueueSharingSingleton {
     private Queue<GaaSObservabilityEventExperimental> queue = new 
LinkedList<>();
     private static INSTANCE = null;
   
     public static QSS getInstance() { ... }
   
     private QueueSharingSingleton {}
   
     public void putMessage(GaaSObservabilityEventExperimental msg) { 
queue.add(msg); }
     public List<GaaSObservabilityEventExperimental> peekAllMessages() { ... }
   }
   ```
   then initialize the above as:
   ```
   private QueueSharingSingleton queueSharing = 
QueueSharingSingleton.getInstance();
   ```
   (and do the same in the mock)
   
   this could even be used by other test classes that should produce 
observability events.
   





Issue Time Tracking
-------------------

    Worklog Id:     (was: 839167)
    Time Spent: 1.5h  (was: 1h 20m)

> Emit GaaSObservabilityEvent
> ---------------------------
>
>                 Key: GOBBLIN-1764
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1764
>             Project: Apache Gobblin
>          Issue Type: New Feature
>          Components: gobblin-service
>            Reporter: William Lo
>            Assignee: Abhishek Tiwari
>            Priority: Major
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> GaaSObservabilityEvents are a new events that provides a job summary from 
> pipelines in GaaS. It differs from GobblinTrackingEvents as it runs once per 
> job pipeline, and it intended to be easily queryable and alert on.
> We want to emit this observability event from GaaS by deriving it from a 
> job's job status. Since this feature is Experimental and WIP, it is not 
> expected to fill out all of the fields immediately.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to