Skip to content

Commit

Permalink
[#121]: 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 203f753 commit 0bd16ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions amqpjobs/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ func (d *Driver) Run(ctx context.Context, p jobs.Pipeline) error {
d.listener(deliv)

atomic.StoreUint32(&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 Down Expand Up @@ -526,7 +526,7 @@ func (d *Driver) Pause(ctx context.Context, p string) error {
zap.String("driver", pipe.Driver()),
zap.String("pipeline", pipe.Name()),
zap.Time("start", start),
zap.Duration("elapsed", time.Since(start)),
zap.Int64("elapsed", time.Since(start).Milliseconds()),
)

return nil
Expand Down Expand Up @@ -595,7 +595,7 @@ func (d *Driver) Resume(ctx context.Context, p string) error {
zap.String("driver", pipe.Driver()),
zap.String("pipeline", pipe.Name()),
zap.Time("start", start),
zap.Duration("elapsed", time.Since(start)),
zap.Int64("elapsed", time.Since(start).Milliseconds()),
)

return nil
Expand All @@ -611,7 +611,7 @@ func (d *Driver) Stop(ctx context.Context) error {
d.stopCh <- struct{}{}

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()))
close(d.redialCh)
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion amqpjobs/redial.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ func (d *Driver) redial(rm *redialMsg) {
return
}

d.log.Info("connection was successfully restored", zap.String("pipeline", pipe.Name()), zap.String("driver", pipe.Driver()), zap.Time("start", t), zap.Duration("elapsed", time.Since(t)))
d.log.Info("connection was successfully restored", zap.String("pipeline", pipe.Name()), zap.String("driver", pipe.Driver()), zap.Time("start", t), zap.Int64("elapsed", time.Since(t).Milliseconds()))

// restart redialer
d.redialer()
Expand Down

0 comments on commit 0bd16ae

Please sign in to comment.