MCPcopy Create free account

hub / github.com/cloudflare/golibs / functions

Functions305 in github.com/cloudflare/golibs

↓ 2 callersMethodroundTrip
(ctx context.Context, method string, url *url.URL, headers http.Header, body []byte)
kt/kt.go:659
↓ 2 callersFunctionunhex
copied from net/url
kt/kt.go:879
↓ 1 callersMethodCapacity
Get the total capacity of the LRU
lrucache/cache.go:44
↓ 1 callersMethodCapacity
()
lrucache/multilru.go:96
↓ 1 callersMethodCapacity
Capacity gets the total capacity of the LRU
lrucache/lrucache.go:310
↓ 1 callersMethodClear
Evict all items from the cache.
lrucache/cache.go:40
↓ 1 callersFunctionDecodeValues
DecodeValues takes a response from an KT RPC call decodes it into a list of key value pairs.
kt/kt.go:784
↓ 1 callersMethodEmpty
Empty Is the buffer empty?
circularbuffer/circularbuffer.go:173
↓ 1 callersMethodExpire
Evict all the expired items.
lrucache/cache.go:55
↓ 1 callersMethodExpire
()
lrucache/multilru.go:104
↓ 1 callersMethodExpireNow
Evict items that expire before Now.
lrucache/cache.go:68
↓ 1 callersMethodExpireNow
(now time.Time)
lrucache/multilru.go:112
↓ 1 callersMethodExpireNow
Evict items that expire before `now`. O(n*log(n))
lrucache/lrucache.go:284
↓ 1 callersMethodGet
(key string)
lrucache/multilru.go:52
↓ 1 callersMethodGet
Get an item from the beginning of the stack (oldest), blocking.
circularbuffer/circularbuffer.go:41
↓ 1 callersMethodGetNotStale
Get a key from the cache, make sure it's not stale. Update its LRU score.
lrucache/cache.go:53
↓ 1 callersMethodGetNotStale
(key string)
lrucache/multilru.go:60
↓ 1 callersMethodGetNotStaleNow
Get a key from the cache, make sure it's not stale. Update its LRU score.
lrucache/cache.go:66
↓ 1 callersMethodGetNotStaleNow
(key string, now time.Time)
lrucache/multilru.go:64
↓ 1 callersMethodGetNotStaleNow
GetNotStaleNow gets a key from the cache, make sure it's not stale. Update its LRU score. O(log(n)) if the item is expired.
lrucache/lrucache.go:201
↓ 1 callersMethodGetSingle
GetSingle gets the lower and upper bounds of a range for a single element. If the element isn't tracked lower bound will be zero and upper bound will
spacesaving/rate.go:196
↓ 1 callersMethodGetStaleNow
GetStaleNow gets a key from the cache, possibly stale. Update its LRU score. O(1) always.
lrucache/lrucache.go:230
↓ 1 callersMethodInit
Initialize already allocated NewEwmaRate structure halfLife it the time takes for a half charge or half discharge
ewma/rate.go:30
↓ 1 callersMethodInit
Initialize already allocated NewEwma structure halfLife it the time takes for a half charge or half discharge
ewma/ewma.go:37
↓ 1 callersMethodInit
Using this constructor is almost always wrong. Use NewMultiLRUCache instead.
lrucache/multilru.go:18
↓ 1 callersMethodInit
Initialize the LRU cache instance. O(capacity)
lrucache/lrucache.go:35
↓ 1 callersFunctionIsError
IsError returns true if the error was generated by this package.
kt/kt.go:57
↓ 1 callersMethodMoveToFront
MoveToFront moves element e to the front of list l. If e is not an element of l, the list is not modified.
lrucache/list.go:188
↓ 1 callersFunctionNewVCache
(capacity uint64)
lrucache/benchmark/vcache.go:13
↓ 1 callersFunctionPoller
(lock *sync.Mutex, ss *spacesaving.Rate, pc *pcap.Pcap)
spacesaving/tools/topdns.go:88
↓ 1 callersMethodPrev
Prev returns the previous list element or nil.
lrucache/list.go:72
↓ 1 callersMethodPush
(x interface{})
spacesaving/srate.go:36
↓ 1 callersMethodPush
(e interface{})
lrucache/priorityqueue.go:23
↓ 1 callersMethodPushElementBack
(e *element)
lrucache/list_extension.go:11
↓ 1 callersMethodSetNow
Methods allowing to explicitly specify time used to determine if items are expired. Add an item to the cache overwriting existing one if it exists. A
lrucache/cache.go:63
↓ 1 callersFunctionTSVEncode
Encode the request body in TSV. The encoding is chosen based on whether there are any binary data in the key/values
kt/kt.go:721
↓ 1 callersMethodUpdateNow
Notify of an event happening. Uses system clock to determine current time. Returns current rate.
ewma/rate.go:38
↓ 1 callersMethodUpdateNow
Update moving average with the value. Uses system clock to determine current time to count wight. Returns updated moving avarage.
ewma/ewma.go:54
↓ 1 callersFunctioncertPaths
(dir string)
kt/kt.go:111
↓ 1 callersMethodcount
(rate float64, lastTs, now int64)
spacesaving/rate.go:144
↓ 1 callersMethodcount
(rate float64, lastTs, now int64)
spacesaving/srate.go:71
↓ 1 callersMethodfreeSomeEntry
(now time.Time)
lrucache/lrucache.go:81
↓ 1 callersFunctionhasBinary
(b string)
kt/kt.go:763
↓ 1 callersFunctionhasBinarySlice
(b []byte)
kt/kt.go:773
↓ 1 callersFunctionhash
hash returns the 64-bit SipHash-2-4 of the given byte slice with two 64-bit parts of 128-bit key: k0 and k1.
tokenbucket/sip.go:16
↓ 1 callersMethodinsertEntry
(e *entry)
lrucache/lrucache.go:114
↓ 1 callersFunctionloadCerts
(rootPath string, certPath string, keyPath string)
kt/kt.go:137
↓ 1 callersFunctionnewUnixConn
(socket string, poolsize int, timeout time.Duration)
kt/kt.go:304
↓ 1 callersFunctionrandomString
(l int)
lrucache/benchmark/main.go:13
↓ 1 callersFunctionsafeParse
(msg *dns.Msg, data []byte)
spacesaving/tools/topdns.go:17
↓ 1 callersFunctionsafeParse
(msg *dns.Msg, data []byte)
spacesaving/tools/readpcap.go:18
↓ 1 callersMethodsetBulk
SetBulk stores the values in the map.
kt/kt.go:531
↓ 1 callersFunctionstartServerUnix
(t testing.TB, sockAddr string)
kt/kt_base_test.go:20
↓ 1 callersMethodtouch
(it *item)
tokenbucket/bucket.go:44
↓ 1 callersFunctionurlenc
encode the key for use in a RESTFUL url KT requires that we use URL escaped values for anything not safe in a query component. Add a slash for the lea
kt/kt.go:936
FunctionBenchmarkBulkBytes
(b *testing.B)
kt/bench_test.go:83
FunctionBenchmarkConcurrentGetLRUCache
(bb *testing.B)
lrucache/lrucache_test.go:329
FunctionBenchmarkConcurrentGetMultiLRU
(bb *testing.B)
lrucache/multilru_test.go:105
FunctionBenchmarkConcurrentSetLRUCache
(bb *testing.B)
lrucache/lrucache_test.go:348
FunctionBenchmarkConcurrentSetMultiLRU
(bb *testing.B)
lrucache/multilru_test.go:124
FunctionBenchmarkConcurrentSetNXLRUCache
No expiry
lrucache/lrucache_test.go:369
FunctionBenchmarkConcurrentSetNXMultiLRU
No expiry
lrucache/multilru_test.go:145
FunctionBenchmarkGet
(b *testing.B)
kt/bench_test.go:41
FunctionBenchmarkGetLarge
(b *testing.B)
kt/bench_test.go:62
FunctionBenchmarkMathExp
math.Exp is the slowest operation in this implementation. Measure just how slow it is. Usually calling math.Exp() is responsible for ~30% of the CPU.
spacesaving/rate_test.go:228
FunctionBenchmarkPool
(b *testing.B)
pool/pool_test.go:120
FunctionBenchmarkSet
(b *testing.B)
kt/bench_test.go:10
FunctionBenchmarkSetLarge
(b *testing.B)
kt/bench_test.go:25
FunctionBenchmarkTouch1024_hundred
Benchmark updating items with 100% hit rate.
spacesaving/rate_test.go:183
FunctionBenchmarkTouch16384_fifty
Benchmark updating times with 50% hit rate.
spacesaving/rate_test.go:165
FunctionBenchmarkTouch16384_hundred
(bb *testing.B)
spacesaving/rate_test.go:199
FunctionBenchmarkTouch16384_ninety
Benchmark updating times with 90% hit rate.
spacesaving/rate_test.go:174
FunctionBenchmarkTouch16384_ten
Benchmark updating times with 10% hit rate.
spacesaving/rate_test.go:156
FunctionBenchmarkTouch2048_hundred
(bb *testing.B)
spacesaving/rate_test.go:187
FunctionBenchmarkTouch32768_fifty
(bb *testing.B)
spacesaving/rate_test.go:169
FunctionBenchmarkTouch32768_hundred
(bb *testing.B)
spacesaving/rate_test.go:203
FunctionBenchmarkTouch32768_ninety
(bb *testing.B)
spacesaving/rate_test.go:178
FunctionBenchmarkTouch32768_ten
(bb *testing.B)
spacesaving/rate_test.go:160
FunctionBenchmarkTouch4096_hundred
(bb *testing.B)
spacesaving/rate_test.go:191
FunctionBenchmarkTouch8192_hundred
(bb *testing.B)
spacesaving/rate_test.go:195
MethodCount
(ctx context.Context)
kt/kt_metrics.go:54
MethodGet
(key string)
lrucache/benchmark/vcache.go:27
MethodGet
(key string)
lrucache/benchmark/mcache.go:34
MethodGet
(ctx context.Context, key string)
kt/kt_metrics.go:84
MethodGetAll
()
spacesaving/count.go:68
MethodGetAll
(nowTs time.Time)
spacesaving/srate.go:125
MethodGetBulk
(ctx context.Context, keysAndVals map[string]string)
kt/kt_metrics.go:74
MethodGetBulkBytes
(ctx context.Context, keys map[string][]byte)
kt/kt_metrics.go:114
MethodGetBytes
(ctx context.Context, key string)
kt/kt_metrics.go:94
MethodGetQuiet
Get a key from the cache, possibly stale. Don't modify its LRU score. O(1)
lrucache/cache.go:36
MethodGetStale
(key string)
lrucache/multilru.go:68
MethodGetStale
GetStale gets a key from the cache, possibly stale. Update its LRU score. O(1) always.
lrucache/lrucache.go:224
MethodGetStaleNow
(key string, now time.Time)
lrucache/multilru.go:72
MethodInit
(size int)
spacesaving/count.go:16
MethodInit
(size int, halfLife time.Duration)
spacesaving/srate.go:60
MethodInit
Init initializes or clears list l.
lrucache/list.go:87
MethodInsertAfter
InsertAfter inserts a new element e with value v immediately after mark and returns e. If mark is not an element of l, the list is not modified.
lrucache/list.go:178
MethodInsertBefore
InsertBefore inserts a new element e with value v immediately before mark and returns e. If mark is not an element of l, the list is not modified.
lrucache/list.go:168
MethodLen
()
spacesaving/rate.go:42
MethodLen
()
spacesaving/rate.go:166
← previousnext →101–200 of 305, ranked by callers