Skip to content

Timing.Send value should be float instead of int #26

Open
@taozle

Description

@taozle

Original:

// Send sends the time elapsed since the creation of the Timing.
func (t Timing) Send(bucket string) {
	t.c.Timing(bucket, int(t.Duration()/time.Millisecond))
}

Because int(t.Duration()/time.Millisecond) will be 0 if t.Duration is less than int(time.Millisecond), so we should correct it like this

// Send sends the time elapsed since the creation of the Timing.
func (t Timing) Send(bucket string) {
	t.c.Timing(bucket, t.Duration().Seconds()*1e3)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions