MCPcopy
hub / github.com/dreadl0ck/netcap / Float64

Method Float64

encoder/encoder.go:154–172  ·  view source on GitHub ↗

Float64 handles encoding of 64bit float values according to the ValueEncoder configuration.

(field string, val float64)

Source from the content-addressed store, hash-verified

152
153// Float64 handles encoding of 64bit float values according to the ValueEncoder configuration.
154func (m *ValueEncoder) Float64(field string, val float64) string {
155
156 var (
157 result string
158 sum = m.GetSummary(TypeNumeric, field)
159 )
160
161 switch {
162 case m.conf.ZScore:
163 result = ZScore(val, sum)
164 case m.conf.MinMax:
165 result = MinMax(val, sum)
166 default:
167 spew.Dump(m.conf)
168 log.Fatal("invalid config: no normalization strategy")
169 }
170
171 return result
172}
173
174// GetSummary returns the summary for the given column type and field name.
175// It will create a new one if none is being tracked yet.

Callers 13

IntMethod · 0.95
Int64Method · 0.95
Int32Method · 0.95
Uint32Method · 0.95
Uint64Method · 0.95
EncodeMethod · 0.80
EncodeMethod · 0.80
EncodeMethod · 0.80
EncodeMethod · 0.80
EncodeMethod · 0.80
EncodeMethod · 0.80
EncodeMethod · 0.80

Calls 4

GetSummaryMethod · 0.95
ZScoreFunction · 0.85
MinMaxFunction · 0.85
DumpMethod · 0.45

Tested by

no test coverage detected