package identity
import "github.com/uber-go/tally/internal/identity"
Index ¶
- func Durations(durs []time.Duration) uint64
- func Float64s(f64s []float64) uint64
- func Int64s(i64s []int64) uint64
- func StringStringMap(m map[string]string) uint64
- type Accumulator
Functions ¶
func Durations ¶
Durations returns the accumulated identity of durs.
func Float64s ¶
Float64s returns the accumulated identity of f64s.
func Int64s ¶
Int64s returns the accumulated identity of i64s.
func StringStringMap ¶
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 ¶
- 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.