You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/10/06 17:01:28 UTC

[GitHub] [beam] riteshghorse commented on a change in pull request #15657: [BEAM-13001] DoFn metrics for Go SDK

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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org