Skip to content

Commit

Permalink
Add exponential Histogram
Browse files Browse the repository at this point in the history
  • Loading branch information
ocelotl committed Sep 12, 2022
1 parent 41b9e26 commit 789b5a1
Show file tree
Hide file tree
Showing 16 changed files with 2,230 additions and 2 deletions.
27 changes: 27 additions & 0 deletions delve_commands.rst
@@ -0,0 +1,27 @@
Run a single test, set break:

ocelotl@hilleman:~/github/lightstep/otel-launcher-go/lightstep/sdk/metric/aggregator/histogram/structure$ dlv test -- -test.run TestAlternatingGrowth1
Type 'help' for list of commands.
(dlv) break tryIncrement
Breakpoint 1 set at 0x68d100,0x68d900,0x68e100,0x68f5e6,0x68f9e6,0x68fde6,0x6901e6,0x68e8e0 for github.com/lightstep/otel-launcher-go/lightstep/sdk/metric/aggregator/histogram/structure.(*bucketsVarwidth).tryIncrement() <autogenerated>:1
(dlv) c
> github.com/lightstep/otel-launcher-go/lightstep/sdk/metric/aggregator/histogram/structure.(*bucketsVarwidth[uint8]).tryIncrement() <autogenerated>:1 (hits goroutine(6):1 total:1) (PC: 0x68f5e6)
(dlv) l
> github.com/lightstep/otel-launcher-go/lightstep/sdk/metric/aggregator/histogram/structure.(*bucketsVarwidth[uint8]).tryIncrement() <autogenerated>:1 (hits goroutine(6):1 total:1) (PC: 0x68f5e6)
Command failed: open <autogenerated>: no such file or directory
(dlv) n
> github.com/lightstep/otel-launcher-go/lightstep/sdk/metric/aggregator/histogram/structure.(*bucketsVarwidth[go.shape.uint8_0]).tryIncrement() ./exponential.go:684 (hits goroutine(6):2 total:2) (PC: 0x68d100)
679: tmp := b.counts[src]
680: b.counts[src] = 0
681: return uint64(tmp)
682: }
683:
=> 684: func (b *bucketsVarwidth[N]) tryIncrement(bucketIndex int32, incr uint64) bool {
685: var limit = uint64(N(0) - 1)
686: if uint64(b.counts[bucketIndex])+incr <= limit {
687: b.counts[bucketIndex] += N(incr)
688: return true
689: }
(dlv) print b.counts
[]uint8 len: 1, cap: 1, [0]
(dlv)
13 changes: 13 additions & 0 deletions iee_754.rst
@@ -0,0 +1,13 @@
IEE 754
=======


A *normalized* number is written in *scientific notation* with one non-zero
decimal digit before the decimal point.

The binary representation of a normalized number will always have its first bit
set to 1. To avoid spending space in this bit, it is implicit.

IEE 754 double precision numbers are represented like this:

1-sign-bit 11-exponent-bits 52-significand-bits for a total of 64 bits.

0 comments on commit 789b5a1

Please sign in to comment.