[
https://issues.apache.org/jira/browse/BEAM-13001?focusedWorklogId=667138&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-667138
]
ASF GitHub Bot logged work on BEAM-13001:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 19/Oct/21 17:00
Start Date: 19/Oct/21 17:00
Worklog Time Spent: 10m
Work Description: riteshghorse commented on a change in pull request
#15657:
URL: https://github.com/apache/beam/pull/15657#discussion_r732071146
##########
File path: sdks/go/pkg/beam/core/metrics/store.go
##########
@@ -174,36 +174,35 @@ type executionTracker struct {
numberOfTransitions int64
millisSinceLastTransition time.Duration
transitionsAtLastSample int64
-}
-
-// executionState is used to store as atomic.Value in Store.
-type pTransformState struct {
- pid string
- state bundleProcState
-}
-
-func newPTransformState(pid string, state bundleProcState) *pTransformState {
- return &pTransformState{pid: pid, state: state}
+ currentState bundleProcState
+ pid string
}
func SetPTransformState(ctx context.Context, state bundleProcState) {
if bctx, ok := ctx.(*beamCtx); ok {
- ps := newPTransformState(bctx.ptransformID, state)
- bctx.pStore.Store(ps)
- atomic.AddInt64(&bctx.transitions, 1)
+ pid := bctx.ptransformID
+ bctx.store.mu.Lock()
+ bctx.store.executionStore.pid = pid
+ bctx.store.executionStore.currentState = state
+ bctx.store.mu.Unlock()
+ atomic.AddInt64(&bctx.store.executionStore.numberOfTransitions,
1)
Review comment:
After having a separate lock, we are back at 2 allocs/op
--
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 667138)
Time Spent: 3h 50m (was: 3h 40m)
> DoFn Execution time metrics (msecs) for Go SDK
> ----------------------------------------------
>
> Key: BEAM-13001
> URL: https://issues.apache.org/jira/browse/BEAM-13001
> Project: Beam
> Issue Type: Improvement
> Components: sdk-go
> Reporter: Ritesh Ghorse
> Assignee: Ritesh Ghorse
> Priority: P2
> Time Spent: 3h 50m
> Remaining Estimate: 0h
>
> Implement DoFn execution time metrics for Go SDK.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)