processor

package
v0.0.0-...-e8f9f86 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MemoryUsage = func(record *types.Record) {
	stat := new(runtime.MemStats)
	runtime.ReadMemStats(stat)
	record.Extra["MemoryUsage"] = stat.Alloc
}

MemoryUsage Get memory usage.

View Source
var ProcessID = func(record *types.Record) {
	record.Extra["Pid"] = os.Getpid()
}

ProcessID Get process ID.

View Source
var UID = func(record *types.Record) {
	now := time.Now()
	sec := now.Unix()
	usec := now.UnixNano() % 0x100000
	record.Extra["Uid"] = fmt.Sprintf("%08x%05x", sec, usec)
}

UID Uniqid processor.

Functions

This section is empty.

Types

This section is empty.

Source Files

  • memory_usage.go
  • process_id.go
  • uid.go

Jump to

Keyboard shortcuts

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