This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"map":{ | |
"filterOut":{"op":"chain", "filter":[ | |
{"op":"field", "from":"UID", "filter":{"op":"trim"}}, | |
{"op":"field", "from":"IP", "filter":{"op":"trim"}}, | |
{"op":"field", "from":"TERMS", "filter":{"op":"trim"}}, | |
{"op":"num", "columns":["QUERY_TIME", "QUERY_TIME_MOD"], "define":"c0,v1000,dmult,v1,set"}, | |
{"op":"debug"}, | |
]}, | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"source":{ | |
"type":"mesh2", | |
"hash":true, | |
"mesh":{ | |
"files":["log-synth/sample*"], | |
}, | |
"format":{ | |
"type":"column", | |
"columns":["QUERY_TIME", "UID", "IP", "TERMS"], | |
"tokens":{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (int p = 10; p < 18; p++) | |
{ | |
ICardinality[] hlls = new ICardinality[30]; | |
int ecount = 15000; | |
int totalCount = ecount * 30; | |
for (int j = 0; j < 30; j++) | |
{ | |
hlls[j] = new HyperLogLogPlus(p, 25); | |
for (int i = 0; i < ecount; i++) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (int p = 10; p < 18; p++) | |
{ | |
HyperLogLogPlus hyperLogLogPlus = new HyperLogLogPlus(p, 25); | |
int count = 4200000; | |
for (int i = 0; i < count; i++) | |
{ | |
hyperLogLogPlus.offer("i" + i); | |
} | |
long estimate = hyperLogLogPlus.cardinality(); | |
double se = count * (1.04 / Math.sqrt(Math.pow(2, p))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(final String[] args) throws Throwable { | |
long startTime = System.currentTimeMillis(); | |
int numSets = 10; | |
int setSize = 1 * 1000 * 1000; | |
int repeats = 5; | |
HyperLogLogPlus[] counters = new HyperLogLogPlus[numSets]; | |
for (int i = 0; i < numSets; i++) { | |
counters[i] = new HyperLogLogPlus(15, 15); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean offer(Object o) | |
{ | |
long x = MurmurHash.hash64(o); | |
switch (format) | |
{ | |
case NORMAL: | |
// find first p bits of x | |
final long idx = x >>> (64 - p); | |
//Ignore the first p bits (the idx), and then find the number of leading zeros |
NewerOlder