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

ASF GitHub Bot logged work on BEAM-13001:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 29/Oct/21 16:21
            Start Date: 29/Oct/21 16:21
    Worklog Time Spent: 10m 
      Work Description: lostluck commented on a change in pull request #15657:
URL: https://github.com/apache/beam/pull/15657#discussion_r739375972



##########
File path: sdks/go/pkg/beam/core/metrics/sampler.go
##########
@@ -55,24 +56,31 @@ func (s *StateSampler) Sample(ctx context.Context, t 
time.Duration) {
                        // state change detected
                        s.millisSinceLastTransition = 0
                        s.transitionsAtLastSample = ps.transitions
+                       s.nextLogTime = s.logInterval
                } else {
                        s.millisSinceLastTransition += t
                }
 
                if s.millisSinceLastTransition > s.nextLogTime {
-                       log.Info(ctx, "...standard long running operation log 
...", ps.pid, ps.state, s.millisSinceLastTransition)
+                       log.Info(ctx, "Operation ongoing in transform "+ps.pid+
+                               " for at least 
"+fmt.Sprint(s.millisSinceLastTransition)+
+                               " without outputting or completing in state 
"+getState(ps.state))

Review comment:
       In Go, don't concat messages, use formatting directives. In this case 
use Infof.
   ```suggestion
                        log.Infof(ctx, "Operation ongoing in transform %v for 
at least %v without outputting or completing in state %v", 
                        ps.pid, s.millisSinceLastTransition, getState(ps.state))
   ```

##########
File path: sdks/go/pkg/beam/core/metrics/sampler.go
##########
@@ -96,3 +104,16 @@ func (s *PTransformState) Set(ctx context.Context, state 
bundleProcState) {
                atomic.AddInt64(bctx.store.transitions, 1)
        }
 }
+
+func getState(s bundleProcState) string {
+       switch s {
+       case 0:
+               return "START_BUNDLE"
+       case 1:
+               return "PROCESS_BUNDLE"
+       case 2:
+               return "FINISH BUNDLE"

Review comment:
       ```suggestion
                return "FINISH_BUNDLE"
   ```




-- 
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: 672047)
    Time Spent: 7h 50m  (was: 7h 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: 7h 50m
>  Remaining Estimate: 0h
>
> Implement DoFn execution time metrics for Go SDK. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to