mirror of
https://github.com/slackhq/nebula.git
synced 2026-11-16 21:56:52 +01:00
handshake/fragment: Carry an optional cookie, with room for it reserved in every fragment
This commit is contained in:
1 parent
a36ce25af4
commit
45e449a591
4 files changed
+110
-13
No files matched your search
@@ -137,6 +137,14 @@ func (t *Table[K, S]) Len() int {
|
||||
return len(t.entries)
|
||||
}
|
||||
|
||||
// Load returns how full the table is, from 0 to 1, by whichever of its byte and
|
||||
// entry limits is closer.
|
||||
func (t *Table[K, S]) Load() float64 {
|
||||
t.mu.Lock()
|
||||
defer t.mu.Unlock()
|
||||
return max(float64(t.bytes)/float64(t.cfg.MaxBytes), float64(len(t.entries))/float64(t.cfg.MaxEntries))
|
||||
}
|
||||
|
||||
// Bytes returns the number of symbol bytes held.
|
||||
func (t *Table[K, S]) Bytes() int {
|
||||
t.mu.Lock()
|
||||
|
||||
Reference in new issue
Block a user