riteshghorse commented on a change in pull request #15657:
URL: https://github.com/apache/beam/pull/15657#discussion_r723505782



##########
File path: sdks/go/pkg/beam/core/runtime/harness/harness.go
##########
@@ -273,6 +273,54 @@ func (c *control) getOrCreatePlan(bdID bundleDescriptorID) 
(*exec.Plan, error) {
        return plan, nil
 }
 
+// Sampler provides methods for implementing state sampling
+// to track execution time metrics.
+type Sampler interface {
+       startSampler()
+       stopSampler()
+       sample()
+}
+
+// StateSampler tracks the state of a bundle.
+type StateSampler struct {
+       done  chan (int) // signal to stop sampling
+       e     *metrics.ExecutionStateTracker
+       store *metrics.Store
+       pid   string // PTransform ID
+}
+
+func newSampler(e *metrics.ExecutionStateTracker, store *metrics.Store, pid 
string) StateSampler {
+       return StateSampler{done: make(chan int), e: e, store: store, pid: pid}
+}
+
+func (s StateSampler) startSampler() {

Review comment:
       Got it.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to