package identity

import "github.com/uber-go/tally/internal/identity"

Index

Functions

func Durations

func Durations(durs []time.Duration) uint64

Durations returns the accumulated identity of durs.

func Float64s

func Float64s(f64s []float64) uint64

Float64s returns the accumulated identity of f64s.

func Int64s

func Int64s(i64s []int64) uint64

Int64s returns the accumulated identity of i64s.

func StringStringMap

func StringStringMap(m map[string]string) uint64

StringStringMap returns the accumulated identity of m.

Types

type Accumulator

type Accumulator uint64

Accumulator is a commutative folding accumulator.

func NewAccumulator

func NewAccumulator() Accumulator

NewAccumulator creates a new Accumulator with a default seed value.

n.b. Here and elsewhere, we use nosplit to avoid stack size checks, which

are unnecessary as memory width is bounded to each instance of `a` (a
uint64) and, potentially, a single stack-local loop temporary while
iterating.

func NewAccumulatorWithSeed

func NewAccumulatorWithSeed(seed uint64) Accumulator

NewAccumulatorWithSeed creates a new Accumulator with the provided seed value.

func (Accumulator) AddString

func (a Accumulator) AddString(str string) Accumulator

AddString hashes str and folds it into the accumulator.

func (Accumulator) AddUint64

func (a Accumulator) AddUint64(u64 uint64) Accumulator

AddUint64 folds u64 into the accumulator.

func (Accumulator) Value

func (a Accumulator) Value() uint64

Value returns the accumulated value.

Source Files

accumulator.go

Version
v3.5.10+incompatible (latest)
Published
Mar 6, 2024
Platform
linux/amd64
Imports
3 packages
Last checked
2 months ago

Tools for package owners.