histogram

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package histogram provides a Histogram struct that represents a histogram of the number of events that occurred in each interval. It also provides a way to transform a Histogram struct into a graphical representation. In addition, it allows to create a Histogram struct from an exp-2 histogram.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Histogram

type Histogram struct {
	Unit      Unit       `json:"unit,omitempty"`
	Intervals []Interval `json:"intervals,omitempty"`
}

Histogram represents a histogram of the number of events that occurred in each interval.

func (*Histogram) String

func (h *Histogram) String() string

String returns a string representation of the histogram. It is a golang adaption of iovisor/bcc print_log2_hist(): https://github.com/iovisor/bcc/blob/13b5563c11f7722a61a17c6ca0a1a387d2fa7788/libbpf-tools/trace_helpers.c#L895-L932

type Interval

type Interval struct {
	Count uint64 `json:"count"`
	Start uint64 `json:"start"`
	End   uint64 `json:"end"`
}

func NewIntervalsFromExp2Slots

func NewIntervalsFromExp2Slots(slots []uint32) []Interval

NewIntervalsFromExp2Slots creates a new Interval array from an exp-2 histogram represented in slots.

type Unit

type Unit string
const (
	UnitMilliseconds Unit = "ms"
	UnitMicroseconds Unit = "µs"
)

Jump to

Keyboard shortcuts

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