Skip to content

Commit

Permalink
Check if duration is zero before overriding
Browse files Browse the repository at this point in the history
Signed-off-by: Geoffrey Beausire <[email protected]>
  • Loading branch information
geobeau committed Feb 13, 2019
1 parent 685907d commit 9e48960
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions model/converter/thrift/zipkin/to_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,21 +200,20 @@ func (td toDomain) getStartTimeAndDuration(zSpan *zipkincore.Span) (int64, int64
if cs != nil {
timestamp = cs.Timestamp
cr := td.findAnnotation(zSpan, zipkincore.CLIENT_RECV)
if cr != nil {
if cr != nil && duration == 0 {
duration = cr.Timestamp - cs.Timestamp
}
} else if sr != nil {
timestamp = sr.Timestamp
ss := td.findAnnotation(zSpan, zipkincore.SERVER_SEND)
if ss != nil {
if ss != nil && duration == 0 {
duration = ss.Timestamp - sr.Timestamp
}
}
}
return timestamp, duration
}


// generateProcess takes a Zipkin Span and produces a model.Process.
// An optional error may also be returned, but it is not fatal.
func (td toDomain) generateProcess(zSpan *zipkincore.Span) (*model.Process, error) {
Expand Down

0 comments on commit 9e48960

Please sign in to comment.