Update poster with latencies
parent
ae7884c354
commit
c15e3a3465
|
@ -5,3 +5,5 @@ scan*.json
|
||||||
latency.json
|
latency.json
|
||||||
country.json
|
country.json
|
||||||
boxplot.csv
|
boxplot.csv
|
||||||
|
|
||||||
|
*test.json
|
||||||
|
|
22
country.go
22
country.go
|
@ -7,9 +7,9 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"math/rand"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type geoRange struct {
|
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")
|
log.Println("Grouping latencies by country")
|
||||||
odata := make(map[string][]int, 0)
|
odata := make(map[string][]int, 0)
|
||||||
j := 0
|
j := 0
|
||||||
for ip, ttl := range data {
|
for _, k := range keys {
|
||||||
if rand.Intn(100) == 0 {
|
/*if rand.Intn(100) == 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}*/
|
||||||
|
ip := uint32(k)
|
||||||
|
ttl := data[ip]
|
||||||
|
|
||||||
for geo[j].End <= ip {
|
for geo[j].End <= ip {
|
||||||
j += 1
|
j += 1
|
||||||
|
@ -119,7 +127,7 @@ func main() {
|
||||||
}
|
}
|
||||||
cc := geo[j].CC
|
cc := geo[j].CC
|
||||||
|
|
||||||
odata[cc] = append(odata[cc], ttl)
|
odata[cc] = append(odata[cc], ttl)
|
||||||
}
|
}
|
||||||
|
|
||||||
total := 0
|
total := 0
|
||||||
|
|
BIN
poster.png
BIN
poster.png
Binary file not shown.
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 1.6 MiB |
79935
poster.svg
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 |
Loading…
Reference in New Issue