Skip to content

Commit

Permalink
[#109]: 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 3d94bc2 commit 658f6e4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions boltjobs/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 {

// increase number of listeners
atomic.AddUint32(&d.listeners, 1)
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 @@ -284,7 +284,7 @@ func (d *Driver) Stop(ctx context.Context) error {
}

pipe := *d.pipeline.Load()
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 d.db.Close()
}

Expand All @@ -310,7 +310,7 @@ func (d *Driver) Pause(ctx context.Context, p string) error {

atomic.AddUint32(&d.listeners, ^uint32(0))

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 number 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 658f6e4

Please sign in to comment.