tracers

package module
v0.0.0-...-b3ff059 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

README

gotracers

codebeat badge Go Report Card Build Status Coverage Status GoDoc

gotracer provides emitters for Sysdig tracers.

Usage

Auto-generated span identifiers:

func myFunc() {
	spanID, err := tracers.Start("mytag")
	handleErr(err)
	defer tracers.End("mytag", spanID)

	...
}

Custom span identifiers:

func myFunc(uniqueId uint64) {
	err := tracers.StartInt("mytag", uniqueId)
	handleErr(err)
	defer tracers.End("mytag", uniqueId)

	...
}
func myFunc(uniqueId string) {
	spanID, err := tracers.StartStr("mytag", uniqueId)
	handleErr(err)
	defer tracers.End("mytag", spanID)

	...
}

Benchmarks

BenchmarkStart-8          	 3000000	       386 ns/op	      32 B/op	       1 allocs/op
BenchmarkStartInt-8       	 5000000	       329 ns/op	      16 B/op	       1 allocs/op
BenchmarkStartStr-8       	 3000000	       523 ns/op	      88 B/op	       3 allocs/op
BenchmarkEnd-8            	 5000000	       363 ns/op	      16 B/op	       1 allocs/op

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func End

func End(tag string, spanID uint64) error

End emits an exit tracer event for the user-provided span identifier.

func Start

func Start(tag string) (uint64, error)

Start generates a random span identifier and emits an entry tracer event.

func StartInt

func StartInt(tag string, spanID uint64) error

StartInt emits an entry tracer event using user-specified span identifier.

func StartStr

func StartStr(tag string, spanID string) (uint64, error)

StartStr emits an entry tracer event using user-specified span identifier.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL