1
0
Fork 0

Update poster with latencies

master
Ambrose Chua 2018-03-24 23:11:19 +08:00
parent ae7884c354
commit c15e3a3465
4 changed files with 79865 additions and 94 deletions

2
.gitignore vendored
View File

@ -5,3 +5,5 @@ scan*.json
latency.json
country.json
boxplot.csv
*test.json

View File

@ -7,9 +7,9 @@ import (
"io/ioutil"
"log"
"os"
"sort"
"strconv"
"strings"
"math/rand"
)
type geoRange struct {
@ -100,14 +100,22 @@ func main() {
}
}
// TODO: verify correctness
log.Println("Sorting IP addresses")
keys := make([]int, 0)
for k, _ := range data {
keys = append(keys, int(k))
}
sort.Ints(keys)
log.Println("Grouping latencies by country")
odata := make(map[string][]int, 0)
j := 0
for ip, ttl := range data {
if rand.Intn(100) == 0 {
continue
}
for _, k := range keys {
/*if rand.Intn(100) == 0 {
continue
}*/
ip := uint32(k)
ttl := data[ip]
for geo[j].End <= ip {
j += 1
@ -119,7 +127,7 @@ func main() {
}
cc := geo[j].CC
odata[cc] = append(odata[cc], ttl)
odata[cc] = append(odata[cc], ttl)
}
total := 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.6 MiB

79935
poster.svg

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 2.4 MiB