Skip to content

Instantly share code, notes, and snippets.

View seiflotfy's full-sized avatar

Seif Lotfy seiflotfy

View GitHub Profile
@seiflotfy
seiflotfy / README.md
Created January 18, 2021 15:51
Install Axiom

Install Axiom

$ helm repo add axiom https://axiomhq.github.io/axiom-helm-charts
$ helm repo update
$ # just to check
$ helm search repo axiom
NAME       	CHART VERSION	APP VERSION	DESCRIPTION  
axiom/axiom	0.2.3        	1.3.0-rc.8 	Axiom Private
@seiflotfy
seiflotfy / metric_test.go
Created August 15, 2018 20:53
metric_test.go
package vegeta
import (
"math/rand"
"reflect"
"testing"
"time"
axiom "github.com/axiomhq/quantiles"
bmizerany "github.com/bmizerany/perks/quantile"
@seiflotfy
seiflotfy / tlc.go
Created March 17, 2018 16:24
HLL to TailCut
func TestHLLTC_Conversion(t *testing.T) {
hash = nopHash
defer func() {
hash = hashFunc
}()
// Populate HLL
hll := NewBeta() // []uint8
for i := range hll {
iteration 1
tailcut base: 1
tailcut est (before rebase): 23634
tailcut est (after rebase): 23635
loglogbeta est: 23635
iteration 2
tailcut base: 2
tailcut est (before rebase): 47271
tailcut est (after rebase): 47271
@seiflotfy
seiflotfy / tlc.go
Created March 17, 2018 14:31
simpler version
tlc := New()
llb := NewBeta()
// Make sure tlc is not using sparse
tlc.sparse = false
tlc.toNormal()
// lets rebase 10 times
for n := uint8(1); n <= 5; n++ {
// make sure we increment all the registers by 1 this iterations (to guarantee a rebase after the loop is done)
tlc := New()
llb := NewBeta()
// Make sure tlc is not using sparse
tlc.sparse = false
tlc.toNormal()
// lets rebase 10 times
for n := uint8(1); n <= 3; n++ {
// make sure we increment all the registers by 1 this iterations (to guarantee a rebase after the loop is done)
>>> inserting val 33 in register 1
iteration 1
tailcut base: 1
tailcut est: 23635
loglogbeta est: 23635
>>> inserting val 34 in register 2
>>> inserting val 33 in register 1
iteration 2
tailcut base: 2
Set 1 HLL 1 Set 2 HLL 2 S1 ∪ S2 HLL1 ∪ HLL2 S1 ∩ S2 HLL1 ∩ HLL2
6987812 6997888 6962294 6951998 8550732 8553641 5399374 (63.000000%) 5398755 (63.116455%)
7141370 7158982 3678358 3684955 8546742 8547740 2272986 (26.000000%) 2314317 (27.075192%)
3124534 3107282 8651079 8604982 10227258 10230622 1548355 (15.000000%) 1506744 (14.727785%)
8850249 8862284 5290225 5308950 9375807 9387095 4764667 (50.000000%) 4781208 (50.933841%)
667001 665795 2030138 2019862 2217972 2209121 479167 (21.000000%) 469897 (21.270768%)
1344715 1355003 5560979 5585400 6788416 6799020 117278 (1.000000%) 122419 (1.800539%)
9527013 9539805 8888494 8904840 13514502 13547342 4901005 (36.000000%) 4923976 (36.346436%)
1336356 1347820 183299 183805 1432428 1439300 87227 (6.000000%) 88551 (6.152
" Specify a directory for plugins
" - For Neovim: ~/.local/share/nvim/plugged
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')
" Make sure you use single quotes
" Shorthand notation; fetches https://github.com/junegunn/vim-easy-align
Plug 'junegunn/vim-easy-align'
@seiflotfy
seiflotfy / cla.md
Created November 5, 2016 22:38
Iron.io CLA

Iron.io, Inc.

Contributor License Agreement

Thank you for your interest in the open source project(s) managed by Iron.io, Inc. (“Iron.io”). In order to clarify the intellectual property license granted with Contributions from any person or entity, Iron.io must have a Contributor License Agreement (“CLA”) on file that has been signed by each contributor, indicating agreement to the license terms below. This license is for your protection as a contributor as well as the protection of Iron.io and its other contributors and users; it does not change your rights to use your own Contributions for any other purpose.

By clicking “Accept” on this page You accept and agree to these terms and conditions for Your present and future Contributions submitted to Iron.io. In return, Iron.io shall consider Your Contributions for addition to the official Iron.io open source project(s) for which they were submitted. Except for the license granted herein to Iron.io and recipients of software distributed by Iron.io, You re