Skip to content

Commit

Permalink
[#103]: elapsed time to milliseconds
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitryuk authored Feb 17, 2024
1 parent 60b64e4 commit cf5d1a2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions beanstalkjobs/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func (d *Driver) Run(ctx context.Context, p jobs.Pipeline) error {

go d.listen()

d.log.Debug("pipeline was started", zap.String("driver", pipe.Driver()), zap.String("pipeline", pipe.Name()), zap.Time("start", start), zap.Duration("elapsed", time.Since(start)))
d.log.Debug("pipeline was started", zap.String("driver", pipe.Driver()), zap.String("pipeline", pipe.Name()), zap.Time("start", start), zap.Int64("elapsed", time.Since(start).Milliseconds()))
return nil
}

Expand All @@ -286,7 +286,7 @@ func (d *Driver) Stop(ctx context.Context) error {
// release associated resources
d.pool.Stop()

d.log.Debug("pipeline was stopped", zap.String("driver", pipe.Driver()), zap.String("pipeline", pipe.Name()), zap.Time("start", start), zap.Duration("elapsed", time.Since(start)))
d.log.Debug("pipeline was stopped", zap.String("driver", pipe.Driver()), zap.String("pipeline", pipe.Name()), zap.Time("start", start), zap.Int64("elapsed", time.Since(start).Milliseconds()))
return nil
}

Expand All @@ -311,7 +311,7 @@ func (d *Driver) Pause(ctx context.Context, p string) error {
atomic.AddUint32(&d.listeners, ^uint32(0))

d.stopCh <- struct{}{}
d.log.Debug("pipeline was paused", zap.String("driver", pipe.Driver()), zap.String("pipeline", pipe.Name()), zap.Time("start", start), zap.Duration("elapsed", time.Since(start)))
d.log.Debug("pipeline was paused", zap.String("driver", pipe.Driver()), zap.String("pipeline", pipe.Name()), zap.Time("start", start), zap.Int64("elapsed", time.Since(start).Milliseconds()))

return nil
}
Expand Down Expand Up @@ -339,7 +339,7 @@ func (d *Driver) Resume(ctx context.Context, p string) error {

// increase num of listeners
atomic.AddUint32(&d.listeners, 1)
d.log.Debug("pipeline was resumed", zap.String("driver", pipe.Driver()), zap.String("pipeline", pipe.Name()), zap.Time("start", start), zap.Duration("elapsed", time.Since(start)))
d.log.Debug("pipeline was resumed", zap.String("driver", pipe.Driver()), zap.String("pipeline", pipe.Name()), zap.Time("start", start), zap.Int64("elapsed", time.Since(start).Milliseconds()))

return nil
}
Expand Down

0 comments on commit cf5d1a2

Please sign in to comment.