Une place pour une véritable innovation. Partagez vos propres utilitaires créés avec la communauté Manjaro.
Questions et discussions sur la programmation et le codage.
Répondre

[Go] un debut de pacman-mirrors en Go

#1Messageil y a 2 ans

:bjr:
Un script tourné vers la programmation et pas fait pour un usage : il ne sauvegarde rien, ne modifie aucune configuration !

C'est du Go, il faut un compilateur d'installé (500Mo :o )
L’intérêt c'est que Go est un langage qui aime les appels asynchrones (les goroutines) - donc la vérification de la vitesse du serveur est meilleure/ beaucoup plus facile qu'avec python

Il ne fait qu'afficher des données !
usage

  -h             : cette aide
  -s             : uniquement les mirrors synchronisés [1 1 1]
  -c             : la liste des pays
  [Country_Nane] : optionnel - un filtre sur un pays
en sortie on obtient:

:: run all test :  9.843313501s
Sorted:
S T U United_Kingdom    02:34 http://mirror.catn.com/pub/manjaro/                           [http] (80) 151.593288ms
S T U Belgium           77:37 http://ftp.belnet.be/mirrors/manjaro/                         [http ftp] (5) 164.491496ms
S T U Poland            00:30 https://mirror.tuchola-dc.pl/manjaro/                         [https http] (65) 208.456138ms
...
S T U Brazil            52:41 http://mirror.ufam.edu.br/manjaro/                            [http] (10) 2.416762552s
S T U Japan             08:00 http://ftp.tsukuba.wide.ad.jp/Linux/manjaro/                  [http] (57) 2.444424572s
S T U South_Africa      16:03 http://manjaro.mirror.ac.za/                                  [http ftp] (71) 2.600995234s
...
S T U Brazil                  https://www.caco.ic.unicamp.br/manjaro/                       [https http] (11) -1
S T U Denmark           00:02 https://www.uex.dk/public/manjaro/                            [https] (27) -4
S T U Brazil                  http://linorg.usp.br/manjaro/                                 [http] (9) -1
S T U Brazil                  http://pet.inf.ufsc.br/mirrors/manjarolinux/                  [http] (8) -1
S T U Indonesia               http://kartolo.sby.datautama.net.id/manjaro/                  [http] (48) -1
S T U Spain                   https://ftp.caliu.cat/pub/distribucions/manjaro/              [https http ftp] (73) -1
sources:

package main

import (
	"encoding/json"
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
	"os"
	"path/filepath"
	"sort"
	"strconv"
	"strings"
	"sync"
	"time"
)

const (
	url_status string = "https://repo.manjaro.org/status.json"
	//https://misc.flogisoft.com/bash/tip_colors_and_formatting
	COLOR_NONE  = "\033[0m"
	COLOR_BLUE  = "\033[0;34m"
	COLOR_GREEN = "\033[0;36m"
	COLOR_RED   = "\033[38;5;124m"
	COLOR_GRAY  = "\033[38;5;243m"
	_VERSION    = "0.0.4"
)

/*
   user values
*/

// input values
type Options struct {
	sync, help, countries, async bool
	country                      string
	limit, timeout               uint64
}

// parse console input values
func argsParser() Options {
	ret := Options{
		async:   true,
		limit:   8,
		timeout: 10,
	}
	limit, err := strconv.ParseUint(os.Getenv("LIMIT"), 10, 8)
	if err != nil || limit < 1 {
		ret.limit = 8
	} else {
		ret.limit = limit
	}
	timeout, err := strconv.ParseUint(os.Getenv("TIMEOUT"), 10, 8)
	if err != nil || timeout < 1 {
		ret.timeout = 10
	} else {
		ret.timeout = timeout
	}

	for _, arg := range os.Args[1:] {
		if len(arg) < 1 {
			// user enter empty values : program.go "" "" "" !
			continue
		}
		if !strings.HasPrefix(arg, "-") {
			// first is country filter
			ret.country = strings.ToLower(arg)
			continue
		}
		// test options
		for _, ch := range arg[1:] {
			switch ch {
			case 'h':
				ret.help = true // TODO usage()
			case 's':
				ret.sync = true
			case 'n':
				ret.async = false
			case 'c':
				ret.countries = true // TODO display list countries
			}
		}
	}

	return ret
}

/*
   JSON structure
*/

// generate with https://mholt.github.io/json-to-go/
type Mirror struct {
	Status    [3]int   `json:"branches"`
	Country   string   `json:"country"`
	LastSync  string   `json:"last_sync"` // can empty
	Protocols []string `json:"protocols"`
	URL       string   `json:"url"`
	id        int
	speed     time.Duration
}

func (m *Mirror) stable() bool {
	return m.Status[0] == 1
}
func (m *Mirror) testing() bool {
	return m.Status[1] == 1
}
func (m *Mirror) unstable() bool {
	return m.Status[2] == 1
}
func (m *Mirror) isBreak() bool {
	return m.Status[0] < 0
}
func (m *Mirror) isSync() bool {
	for _, value := range m.Status {
		if value != 1 {
			return false
		}
	}
	return true
}
func (m *Mirror) sortSpeed() time.Duration {
	if m.speed < 1 {
		return 99999999999
	}
	return m.speed
}

// test mirror speed
func (m *Mirror) testSpeed(timeout uint64) (time.Duration, error) {
	m.speed = -1
	path := "/tmp/mirrors-test"
	if _, err := os.Stat(path); os.IsNotExist(err) {
		os.Mkdir(path, 0700)
	}
	path = fmt.Sprintf("%v/%v", path, m.id)
	url := m.URL + "stable/core/x86_64/core.db.tar.gz"

	client := http.Client{Timeout: time.Duration(timeout) * time.Second}
	resp, err := client.Get(url)
	if err != nil {
		return -2, err
	}
	defer resp.Body.Close()
	if resp.StatusCode > 399 {
		return -3, fmt.Errorf("http error: %v", resp.StatusCode)
	}
	//fmt.Println(resp)

	// Create file
	out, err := os.Create(path)
	if err != nil {
		return -1, err
	}
	defer out.Close()

	start := time.Now() // start timer

	// read file and write datas in tmp file
	_, err = io.Copy(out, resp.Body)

	// test size ...
	size, _ := strconv.Atoi(resp.Header.Get("Content-Length")) // bad with some servers ! too small
	downloadSize := int64(size)
	fstat, err := out.Stat()
	if fstat.Size() > downloadSize {
		// timer has expired, we have not all datas
		m.speed = -4
		return m.speed, fmt.Errorf("Bad file sizes %v > %v (downloaded)", fstat.Size(), downloadSize)
	}

	defer func() {
		elapsed := time.Since(start)
		m.speed = elapsed
	}()

	return m.speed, nil
}

func (m *Mirror) displayStatus() string {
	fields := [3]string{"S", "T", "U"}
	for i, id := range fields {
		color := COLOR_GREEN
		if m.Status[i] != 1 {
			color = COLOR_RED
		}
		fields[i] = fmt.Sprintf("%v%v%v", color, id, COLOR_NONE)
	}
	return strings.Join(fields[:], " ")
}

func (m Mirror) String() string {
	var dur string
	if m.speed < 1 {
		dur = fmt.Sprintf("%v%v%v %v", COLOR_RED, int64(m.speed), COLOR_NONE, m.Status)
	} else {
		dur = fmt.Sprintf("%v%v%v", COLOR_GREEN, m.speed, COLOR_NONE)
	}
	return fmt.Sprintf("%v %-17v %5v %-61v %v (%v) %s", m.displayStatus(), m.Country, m.LastSync, m.URL, m.Protocols, m.id, dur)
}

type Mirrors []Mirror

// download manjaro json, return slice struct of all mirrors
func downloadDatas(wantSync bool, wantCountry string) (Mirrors, error) {
	resp, err := http.Get(url_status)
	if err != nil {
		return nil, err
	}

	defer resp.Body.Close()
	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return nil, err
	}

	var datas Mirrors
	json.Unmarshal([]byte(body), &datas)

	var ret Mirrors
	for id, _ := range datas {
		datas[id].id = id
		// set filters
		if wantSync && !datas[id].isSync() {
			continue
		}
		if wantCountry != "" && strings.ToLower(datas[id].Country) != wantCountry {
			continue
		}
		ret = append(ret, datas[id])
	}

	sort.Slice(ret, func(i, j int) bool {
		return ret[i].Country < ret[j].Country
	})

	return ret, nil
}

// display coutries list and exit
func displayContries(mirrors *Mirrors) {
	countries := func() []string {
		rets := []string{}

		for _, s := range *mirrors {
			if !func(c string) bool {
				for _, value := range rets {
					if value == c {
						return true
					}
				}
				return false
			}(s.Country) {
				rets = append(rets, s.Country)
			}
		}
		return rets
	}()
	fmt.Println(countries)
	os.Exit(0)
}

func usage(options *Options) {
	fmt.Printf("Usage: %v [Country_Nane]\n", filepath.Base(os.Args[0]))
	fmt.Printf("  %-15v: this help\n", "-h")
	fmt.Printf("  %-15v: only updated mirrors [1 1 1]\n", "-s")
	fmt.Printf("  %-15v: countries list\n", "-c")
	fmt.Printf("  %-15v: no async !\n", "-n")
	fmt.Printf("  %-15v: optional - country filter\n", "[Country_Nane]")
	fmt.Printf("\nenv LIMIT=%v (allowed to run concurrently)\n", options.limit)
	fmt.Printf("\nenv TIMEOUT=%v http request timeout\n", options.timeout)
	os.Exit(0)
}

/*
   main Application
*/

func main() {
	println("mirrors manjaro...")

	options := argsParser()

	var mirrors Mirrors
	mirrors, err := downloadDatas(options.sync, options.country)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(2)
	}
	println("")

	if options.help {
		usage(&options)
	}

	if options.countries {
		displayContries(&mirrors)
	}

	// for info display list
	fmt.Println(len(mirrors), "Manjaro mirrors")
	for _, mirror := range mirrors {
		fmt.Println(mirror)
	}
	println("")
	//os.Exit(0)

	/*
	   async test speed
	*/

	type Message struct {
		id  int
		msg string
	}

	var waitg sync.WaitGroup
	var mutex = sync.Mutex{}
	sem := make(chan bool, 16) // limit async

	println("Speed tests ...")
	start := time.Now() // start timer
	for id, _ := range mirrors[:] {
		waitg.Add(1)
		go func(id int) {
			if options.async {
				sem <- true
				defer func() { <-sem }()
			}
			m := mirrors[id]
			defer waitg.Done()
			_, err := m.testSpeed(options.timeout)
			if err != nil {
				fmt.Println(m.id, COLOR_RED, err.Error(), COLOR_NONE)
			}
			mutex.Lock()
			mirrors[id] = m
			mutex.Unlock()
			fmt.Println("Duration:", m.speed, m.Country, m.URL, m.id)
			if !options.async {
				sem <- true
			}
		}(id)
		if !options.async {
			<-sem
		}
	}
	waitg.Wait()
	close(sem)
	fmt.Println("\n:: run all test : ", time.Since(start), "\n")

	sort.Slice(mirrors, func(i, j int) bool {
		return mirrors[i].sortSpeed() < mirrors[j].sortSpeed()
	})

	println("Sorted:")
	for _, mirror := range mirrors {
		fmt.Println(mirror)
	}
}

[Go] un debut de pacman-mirrors en Go

#2Messageil y a 2 ans

:bjr:
Quel compilateur utilises-tu ?
J'ai go 2:1.12.7-1 et ça semble bien fonctionner. J'ai nommé ton script en <go-mirrors.go> puis l'ai rendu exécutable.

[steph@steph-tour .scripts]$ go run go-mirrors.go 
mirrors manjaro...

90 Manjaro mirrors
S T U Australia         01:47 http://manjaro.melbourneitmirror.net/                         [http] (0) 0 [1 1 1]
S T U Austria           05:50 http://mirror.inode.at/manjaro/                               [http] (1) 0 [1 1 1]
S T U Austria           00:20 http://mirror.easyname.at/manjaro/                            [http ftp] (2) 0 [1 1 1]
S T U Bangladesh        01:47 http://mirror.xeonbd.com/manjaro/                             [http] (3) 0 [1 1 1]
S T U Belarus           01:40 http://mirror.datacenter.by/pub/mirrors/manjaro/              [http] (4) 0 [1 1 1]
S T U Belgium           81:57 http://ftp.belnet.be/mirrors/manjaro/                         [http ftp] (5) 0 [0 0 0]
S T U Belgium           00:27 http://mirror.futureweb.be/manjaro/                           [https http] (6) 0 [1 1 1]
S T U Brazil            01:17 https://manjaro.c3sl.ufpr.br/                                 [https] (7) 0 [1 1 1]
S T U Brazil                  http://pet.inf.ufsc.br/mirrors/manjarolinux/                  [http] (8) 0 [-1 -1 -1]
S T U Brazil            05:50 http://linorg.usp.br/manjaro/                                 [http] (9) 0 [1 1 1]
S T U Brazil            57:01 http://mirror.ufam.edu.br/manjaro/                            [http] (10) 0 [0 0 0]
S T U Brazil                  https://www.caco.ic.unicamp.br/manjaro/                       [https http] (11) 0 [-1 -1 -1]
S T U Bulgaria          00:21 https://mirrors.netix.net/manjaro/                            [https] (12) 0 [1 1 1]
S T U Bulgaria          00:51 https://manjaro.ipacct.com/manjaro/                           [https] (13) 0 [1 1 1]
S T U Bulgaria          02:18 http://manjaro.telecoms.bg/                                   [http] (14) 0 [1 1 1]
S T U Canada            00:21 https://osmirror.org/manjaro/                                 [https] (15) 0 [1 1 1]
S T U Chile             01:18 http://manjaro.dcc.uchile.cl/                                 [http] (16) 0 [1 1 1]
S T U Chile             00:08 https://mirror.ufro.cl/manjaro/                               [https http] (17) 0 [1 1 1]
S T U China             04:41 https://mirrors.huaweicloud.com/manjaro/                      [https http] (18) 0 [1 1 1]
S T U China             07:41 https://mirrors.ustc.edu.cn/manjaro/                          [https] (19) 0 [1 1 1]
S T U China             04:42 http://mirrors.tuna.tsinghua.edu.cn/manjaro/                  [http] (20) 0 [1 1 1]
S T U China             04:42 https://mirrors.zju.edu.cn/manjaro/                           [https] (21) 0 [1 1 1]
S T U China             01:42 https://mirrors.sjtug.sjtu.edu.cn/manjaro/                    [https] (22) 0 [1 1 1]
S T U Colombia          1402:35 http://mirror.upb.edu.co/manjaro/                             [http] (24) 0 [0 0 0]
S T U Costa_Rica        02:22 https://mirrors.ucr.ac.cr/manjaro/                            [https] (23) 0 [1 1 1]
S T U Czech             05:52 https://mirror.dkm.cz/manjaro/                                [https] (25) 0 [1 1 1]
S T U Denmark           00:39 https://mirrors.dotsrc.org/manjaro/                           [https] (26) 0 [1 1 1]
S T U Denmark           00:02 https://www.uex.dk/public/manjaro/                            [https] (27) 0 [1 1 1]
S T U Ecuador           03:19 http://mirror.espoch.edu.ec/manjaro/                          [http] (29) 0 [1 1 1]
S T U Ecuador           01:29 https://mirror.cedia.org.ec/manjaro/                          [https] (28) 0 [1 1 1]
S T U France            05:52 https://mirror.oldsql.cc/manjaro/                             [https] (30) 0 [1 1 1]
S T U France            00:22 https://manjaro.ynh.ovh/                                      [https] (31) 0 [1 1 1]
S T U France            04:59 http://ftp.free.org/mirrors/repo.manjaro.org/repos/           [ftp http] (32) 0 [1 1 1]
S T U France            00:52 http://kibo.remi.lu/                                          [http] (33) 0 [1 1 1]
S T U Georgia           05:52 https://manjaro.grena.ge/                                     [https http] (34) 0 [1 1 1]
S T U Germany           00:02 https://manjaro.moson.eu/                                     [http https] (44) 0 [1 1 1]
S T U Germany           01:49 https://mirror.23media.com/manjaro/                           [https http] (36) 0 [1 1 1]
S T U Germany           00:22 http://mirror.ragenetwork.de/manjaro/                         [http] (37) 0 [1 1 1]
S T U Germany           05:52 https://ftp.halifax.rwth-aachen.de/manjaro/                   [ftp https] (38) 0 [1 1 1]
S T U Germany           00:02 https://mirror.alpix.eu/manjaro/                              [https] (35) 0 [1 1 1]
S T U Germany           00:22 https://mirror.netzspielplatz.de/manjaro/packages/            [https] (40) 0 [1 1 1]
S T U Germany           04:59 https://mirror.netcologne.de/manjaro/                         [https] (41) 0 [1 1 1]
S T U Germany           06:22 http://ftp.rz.tu-bs.de/pub/mirror/manjaro.org/repos/          [ftp http] (42) 0 [0 0 0]
S T U Germany           00:02 https://mirror.philpot.de/manjaro/                            [http https] (43) 0 [1 1 1]
S T U Germany           04:39 http://ftp.tu-chemnitz.de/pub/linux/manjaro/                  [ftp http] (39) 0 [1 1 1]
S T U Greece            00:09 https://ftp.cc.uoc.gr/mirrors/linux/manjaro/                  [ftp http https] (45) 0 [1 1 1]
S T U Hong_Kong         12:19 http://ftp.cuhk.edu.hk/pub/Linux/manjaro/                     [ftp http] (46) 0 [1 1 1]
S T U Hungary           00:22 https://quantum-mirror.hu/mirrors/pub/manjaro/                [https http] (47) 0 [1 1 1]
S T U Indonesia               http://kartolo.sby.datautama.net.id/manjaro/                  [http] (48) 0 [-1 -1 -1]
S T U Indonesia         01:42 https://mirror.deace.id/manjaro/                              [https http] (49) 0 [1 1 1]
S T U Iran              11:53 https://repo.iut.ac.ir/repo/manjaro/                          [https http] (51) 0 [1 1 1]
S T U Iran              03:29 https://repo.sadjad.ac.ir/manjaro/                            [https http] (50) 0 [1 1 1]
S T U Iran              11:53 https://repo.iut.ac.ir/repo/manjaro/                          [https http] (52) 0 [1 1 1]
S T U Italy             05:53 https://manjaro.mirror.garr.it/mirrors/manjaro/               [https] (53) 0 [1 1 1]
S T U Italy             05:53 https://ba.mirror.garr.it/mirrors/manjaro/                    [https] (54) 0 [1 1 1]
S T U Italy             05:53 https://ct.mirror.garr.it/mirrors/manjaro/                    [https] (55) 0 [1 1 1]
S T U Japan             11:53 http://ftp.riken.jp/Linux/manjaro/                            [ftp http] (56) 0 [1 1 1]
S T U Japan             12:20 http://ftp.tsukuba.wide.ad.jp/Linux/manjaro/                  [http] (57) 0 [1 1 1]
S T U Kenya             05:53 https://manjaro.mirror.liquidtelecom.com/                     [https http] (58) 0 [1 1 1]
S T U Netherlands       06:53 https://mirror.neostrada.nl/manjaro/                          [ftp http https] (59) 0 [1 1 1]
S T U Netherlands       04:23 https://ftp.nluug.nl/pub/os/Linux/distr/manjaro/              [ftp https] (60) 0 [1 1 1]
S T U Netherlands       05:53 http://ftp.snt.utwente.nl/pub/linux/manjaro/                  [ftp http] (61) 0 [1 1 1]
S T U Netherlands       04:20 https://mirror.koddos.net/manjaro/                            [https] (62) 0 [1 1 1]
S T U New_Zealand       00:53 https://manjaro.mirrors.theom.nz/                             [https http] (63) 0 [1 1 1]
S T U Philippines       12:20 http://mirror.rise.ph/manjaro/                                [http ftp] (64) 0 [1 1 1]
S T U Poland            00:20 https://mirror.tuchola-dc.pl/manjaro/                         [https http] (65) 0 [1 1 1]
S T U Poland            05:53 http://ftp.vectranet.pl/manjaro/                              [http ftp] (66) 0 [1 1 1]
S T U Portugal          05:53 http://ftp.dei.uc.pt/pub/linux/manjaro/                       [http ftp] (67) 0 [1 1 1]
S T U Russia            01:43 http://mirror.truenetwork.ru/manjaro/                         [http] (69) 0 [1 1 1]
S T U Russia            01:43 https://mirror.yandex.ru/mirrors/manjaro/                     [https] (68) 0 [1 1 1]
S T U South_Africa      01:50 http://mirror.is.co.za/mirrors/manjaro.org/                   [http] (70) 0 [1 1 1]
S T U South_Africa      20:23 http://manjaro.mirror.ac.za/                                  [http ftp] (71) 0 [1 1 0]
S T U South_Korea       02:23 http://mirror.d-tl.com/manjaro/                               [http] (72) 0 [1 1 1]
S T U Spain                   https://ftp.caliu.cat/pub/distribucions/manjaro/              [https http ftp] (73) 0 [-1 -1 -1]
S T U Sweden            00:14 https://ftp.lysator.liu.se/pub/manjaro/                       [ftp https] (74) 0 [1 1 1]
S T U Sweden            02:14 https://mirror.zetup.net/manjaro/                             [https] (75) 0 [1 1 1]
S T U Sweden            00:14 https://mirror.operationtulip.com/manjaro/                    [https http] (76) 0 [1 1 1]
S T U Taiwan            02:41 http://free.nchc.org.tw/manjaro/                              [http] (77) 0 [1 1 1]
S T U Turkey            05:54 http://ftp.linux.org.tr/manjaro/                              [ftp http] (78) 0 [1 1 1]
S T U Ukraine           00:41 http://mirrors.colocall.net/manjaro/                          [http ftp] (79) 0 [1 1 1]
S T U United_Kingdom    00:14 http://repo.manjaro.org.uk/                                   [http] (81) 0 [1 1 1]
S T U United_Kingdom    05:01 https://www.mirrorservice.org/sites/repo.manjaro.org/repos/   [https] (82) 0 [1 1 1]
S T U United_Kingdom    00:31 http://manjaro.mirrors.uk2.net/                               [http] (83) 0 [1 1 1]
S T U United_Kingdom    00:54 http://mirror.catn.com/pub/manjaro/                           [http] (80) 0 [1 1 1]
S T U United_States     00:54 https://repo.ialab.dsu.edu/manjaro/                           [https http] (84) 0 [1 1 1]
S T U United_States     04:14 https://mirrors.gigenet.com/manjaro/                          [https http] (89) 0 [1 1 1]
S T U United_States           http://mirror.dacentec.com/manjaro/                           [http] (85) 0 [-1 -1 -1]
S T U United_States     23:51 http://distro.ibiblio.org/manjaro/                            [http] (86) 0 [1 1 0]
S T U United_States     11:31 https://mirrors.ocf.berkeley.edu/manjaro/                     [https] (87) 0 [1 1 1]
S T U United_States     00:14 https://mirror.math.princeton.edu/pub/manjaro/                [https] (88) 0 [1 1 1]

Speed tests ...
Duration: 1.528327071s Brazil http://linorg.usp.br/manjaro/ 9
Duration: 1.865768348s United_States https://mirror.math.princeton.edu/pub/manjaro/ 88
Duration: 1.595868626s Brazil http://mirror.ufam.edu.br/manjaro/ 10
Duration: 206.089617ms Australia http://manjaro.melbourneitmirror.net/ 0
11  Get https://www.caco.ic.unicamp.br/manjaro/stable/core/x86_64/core.db.tar.gz: net/http: request canceled (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns Brazil https://www.caco.ic.unicamp.br/manjaro/ 11
Duration: 2.438286714s Austria http://mirror.inode.at/manjaro/ 1
12  Get https://mirrors.netix.net/manjaro/stable/core/x86_64/core.db.tar.gz: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns Bulgaria https://mirrors.netix.net/manjaro/ 12
13  Get https://manjaro.ipacct.com/manjaro/stable/core/x86_64/core.db.tar.gz: net/http: request canceled (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns Bulgaria https://manjaro.ipacct.com/manjaro/ 13
Duration: 2.757301245s Austria http://mirror.easyname.at/manjaro/ 2
Duration: 847.432737ms Bangladesh http://mirror.xeonbd.com/manjaro/ 3
Duration: 2.02487634s Bulgaria http://manjaro.telecoms.bg/ 14
Duration: 2.331327375s Belarus http://mirror.datacenter.by/pub/mirrors/manjaro/ 4
15  Get https://osmirror.org/manjaro/stable/core/x86_64/core.db.tar.gz: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns Canada https://osmirror.org/manjaro/ 15
Duration: 1.656361687s Chile http://manjaro.dcc.uchile.cl/ 16
17  Get https://mirror.ufro.cl/manjaro/stable/core/x86_64/core.db.tar.gz: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns Chile https://mirror.ufro.cl/manjaro/ 17
Duration: 2.692288859s Belgium http://ftp.belnet.be/mirrors/manjaro/ 5
Duration: 2.456150882s Belgium http://mirror.futureweb.be/manjaro/ 6
7  Get https://manjaro.c3sl.ufpr.br/stable/core/x86_64/core.db.tar.gz: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns Brazil https://manjaro.c3sl.ufpr.br/ 7
8  Get http://pet.inf.ufsc.br/mirrors/manjarolinux/stable/core/x86_64/core.db.tar.gz: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns Brazil http://pet.inf.ufsc.br/mirrors/manjarolinux/ 8
18  Get https://mirrors.huaweicloud.com/manjaro/stable/core/x86_64/core.db.tar.gz: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns China https://mirrors.huaweicloud.com/manjaro/ 18
19  Get https://mirrors.ustc.edu.cn/manjaro/stable/core/x86_64/core.db.tar.gz: net/http: request canceled (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns China https://mirrors.ustc.edu.cn/manjaro/ 19
Duration: 926.327454ms China http://mirrors.tuna.tsinghua.edu.cn/manjaro/ 20
21  Get https://mirrors.zju.edu.cn/manjaro/stable/core/x86_64/core.db.tar.gz: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns China https://mirrors.zju.edu.cn/manjaro/ 21
22  Get https://mirrors.sjtug.sjtu.edu.cn/manjaro/stable/core/x86_64/core.db.tar.gz: net/http: request canceled (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns China https://mirrors.sjtug.sjtu.edu.cn/manjaro/ 22
Duration: 613.991589ms Colombia http://mirror.upb.edu.co/manjaro/ 24
Duration: 341.893223ms Costa_Rica https://mirrors.ucr.ac.cr/manjaro/ 23
Duration: 1.482570456s Czech https://mirror.dkm.cz/manjaro/ 25
Duration: 2.243786567s Denmark https://mirrors.dotsrc.org/manjaro/ 26
Duration: 700.78693ms Denmark https://www.uex.dk/public/manjaro/ 27
Duration: 1.796603047s Ecuador http://mirror.espoch.edu.ec/manjaro/ 29
28  Get https://mirror.cedia.org.ec/manjaro/stable/core/x86_64/core.db.tar.gz: net/http: request canceled (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns Ecuador https://mirror.cedia.org.ec/manjaro/ 28
Duration: 445.801954ms France https://mirror.oldsql.cc/manjaro/ 30
31  Get https://manjaro.ynh.ovh/stable/core/x86_64/core.db.tar.gz: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns France https://manjaro.ynh.ovh/ 31
Duration: 2.376364221s France http://ftp.free.org/mirrors/repo.manjaro.org/repos/ 32
Duration: 2.25157235s France http://kibo.remi.lu/ 33
34  Get https://manjaro.grena.ge/stable/core/x86_64/core.db.tar.gz: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns Georgia https://manjaro.grena.ge/ 34
44  Get https://manjaro.moson.eu/stable/core/x86_64/core.db.tar.gz: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns Germany https://manjaro.moson.eu/ 44
Duration: 555.13996ms Germany https://mirror.23media.com/manjaro/ 36
Duration: 1.083963333s Germany http://mirror.ragenetwork.de/manjaro/ 37
Duration: 538.25173ms Germany https://ftp.halifax.rwth-aachen.de/manjaro/ 38
Duration: 354.530935ms Germany https://mirror.alpix.eu/manjaro/ 35
40  Get https://mirror.netzspielplatz.de/manjaro/packages/stable/core/x86_64/core.db.tar.gz: net/http: request canceled (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns Germany https://mirror.netzspielplatz.de/manjaro/packages/ 40
41  Get https://mirror.netcologne.de/manjaro/stable/core/x86_64/core.db.tar.gz: net/http: request canceled (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns Germany https://mirror.netcologne.de/manjaro/ 41
Duration: 324.587551ms Germany http://ftp.rz.tu-bs.de/pub/mirror/manjaro.org/repos/ 42
43  Get https://mirror.philpot.de/manjaro/stable/core/x86_64/core.db.tar.gz: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns Germany https://mirror.philpot.de/manjaro/ 43
Duration: 1.2115799s Germany http://ftp.tu-chemnitz.de/pub/linux/manjaro/ 39
Duration: 734.166997ms Greece https://ftp.cc.uoc.gr/mirrors/linux/manjaro/ 45
Duration: 808.389424ms Hong_Kong http://ftp.cuhk.edu.hk/pub/Linux/manjaro/ 46
Duration: 1.50789174s Hungary https://quantum-mirror.hu/mirrors/pub/manjaro/ 47
48  Get http://kartolo.sby.datautama.net.id/manjaro/stable/core/x86_64/core.db.tar.gz: net/http: request canceled (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns Indonesia http://kartolo.sby.datautama.net.id/manjaro/ 48
Duration: 543.512734ms Indonesia https://mirror.deace.id/manjaro/ 49
Duration: 646.368µs Iran https://repo.iut.ac.ir/repo/manjaro/ 51
50  Get https://repo.sadjad.ac.ir/manjaro/stable/core/x86_64/core.db.tar.gz: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns Iran https://repo.sadjad.ac.ir/manjaro/ 50
52  Get https://repo.iut.ac.ir/repo/manjaro/stable/core/x86_64/core.db.tar.gz: net/http: request canceled (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns Iran https://repo.iut.ac.ir/repo/manjaro/ 52
53  Get https://manjaro.mirror.garr.it/mirrors/manjaro/stable/core/x86_64/core.db.tar.gz: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns Italy https://manjaro.mirror.garr.it/mirrors/manjaro/ 53
54  Get http://manjaro.mirror.garr.it/manjaro/stable/core/x86_64/core.db.tar.gz: net/http: request canceled (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns Italy https://ba.mirror.garr.it/mirrors/manjaro/ 54
55  Get https://ct.mirror.garr.it/mirrors/manjaro/stable/core/x86_64/core.db.tar.gz: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns Italy https://ct.mirror.garr.it/mirrors/manjaro/ 55
Duration: 1.045949214s Japan http://ftp.riken.jp/Linux/manjaro/ 56
Duration: 944.266601ms Japan http://ftp.tsukuba.wide.ad.jp/Linux/manjaro/ 57
58  Get https://manjaro.mirror.liquidtelecom.com/stable/core/x86_64/core.db.tar.gz: net/http: request canceled (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns Kenya https://manjaro.mirror.liquidtelecom.com/ 58
Duration: 1.21967213s Netherlands https://mirror.neostrada.nl/manjaro/ 59
60  Get https://ftp.nluug.nl/pub/os/Linux/distr/manjaro/stable/core/x86_64/core.db.tar.gz: net/http: request canceled (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns Netherlands https://ftp.nluug.nl/pub/os/Linux/distr/manjaro/ 60
Duration: 2.390949837s Netherlands http://ftp.snt.utwente.nl/pub/linux/manjaro/ 61
62  Get https://mirror.koddos.net/manjaro/stable/core/x86_64/core.db.tar.gz: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns Netherlands https://mirror.koddos.net/manjaro/ 62
63  Get https://manjaro.mirrors.theom.nz/stable/core/x86_64/core.db.tar.gz: net/http: request canceled (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns New_Zealand https://manjaro.mirrors.theom.nz/ 63
64  Get http://mirror.rise.ph/manjaro/stable/core/x86_64/core.db.tar.gz: net/http: request canceled (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns Philippines http://mirror.rise.ph/manjaro/ 64
Duration: 793.577624ms Poland https://mirror.tuchola-dc.pl/manjaro/ 65
66  Get http://ftp.vectranet.pl/manjaro/stable/core/x86_64/core.db.tar.gz: net/http: request canceled (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns Poland http://ftp.vectranet.pl/manjaro/ 66
Duration: 2.171536528s Portugal http://ftp.dei.uc.pt/pub/linux/manjaro/ 67
Duration: 2.239312909s Russia http://mirror.truenetwork.ru/manjaro/ 69
68  Get https://mirror.yandex.ru/mirrors/manjaro/stable/core/x86_64/core.db.tar.gz: net/http: request canceled (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns Russia https://mirror.yandex.ru/mirrors/manjaro/ 68
Duration: 1.295212958s South_Africa http://mirror.is.co.za/mirrors/manjaro.org/ 70
Duration: 1.837754697s South_Africa http://manjaro.mirror.ac.za/ 71
72  Get https://mirror.d-tl.com/manjaro/stable/core/x86_64/core.db.tar.gz: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns South_Korea http://mirror.d-tl.com/manjaro/ 72
73  Get https://ftp.caliu.cat/pub/distribucions/manjaro/stable/core/x86_64/core.db.tar.gz: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns Spain https://ftp.caliu.cat/pub/distribucions/manjaro/ 73
74  Get https://ftp.lysator.liu.se/pub/manjaro/stable/core/x86_64/core.db.tar.gz: net/http: request canceled (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns Sweden https://ftp.lysator.liu.se/pub/manjaro/ 74
75  Get https://mirror.zetup.net/manjaro/stable/core/x86_64/core.db.tar.gz: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns Sweden https://mirror.zetup.net/manjaro/ 75
76  Get https://mirror.operationtulip.com/manjaro/stable/core/x86_64/core.db.tar.gz: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns Sweden https://mirror.operationtulip.com/manjaro/ 76
Duration: 1.657413376s Taiwan http://free.nchc.org.tw/manjaro/ 77
Duration: 1.422194102s Turkey http://ftp.linux.org.tr/manjaro/ 78
Duration: 2.134301576s Ukraine http://mirrors.colocall.net/manjaro/ 79
Duration: 2.290847531s United_Kingdom http://repo.manjaro.org.uk/ 81
82  Get https://www.mirrorservice.org/sites/repo.manjaro.org/repos/stable/core/x86_64/core.db.tar.gz: net/http: request canceled (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns United_Kingdom https://www.mirrorservice.org/sites/repo.manjaro.org/repos/ 82
Duration: 2.466662804s United_Kingdom http://manjaro.mirrors.uk2.net/ 83
Duration: 1.330496696s United_Kingdom http://mirror.catn.com/pub/manjaro/ 80
Duration: 1.263968162s United_States https://repo.ialab.dsu.edu/manjaro/ 84
Duration: 459.127037ms United_States https://mirrors.gigenet.com/manjaro/ 89
85  Get https://mirror.dacentec.com/manjaro/stable/core/x86_64/core.db.tar.gz: net/http: request canceled (Client.Timeout exceeded while awaiting headers) 
Duration: -1ns United_States http://mirror.dacentec.com/manjaro/ 85
Duration: 546.920217ms United_States http://distro.ibiblio.org/manjaro/ 86
Duration: 52.844217ms United_States https://mirrors.ocf.berkeley.edu/manjaro/ 87

:: run all test :  18.023631048s 

Sorted:
S T U Iran              11:53 https://repo.iut.ac.ir/repo/manjaro/                          [https http] (51) 646.368µs
S T U United_States     11:31 https://mirrors.ocf.berkeley.edu/manjaro/                     [https] (87) 52.844217ms
S T U Australia         01:47 http://manjaro.melbourneitmirror.net/                         [http] (0) 206.089617ms
S T U Germany           06:22 http://ftp.rz.tu-bs.de/pub/mirror/manjaro.org/repos/          [ftp http] (42) 324.587551ms
S T U Costa_Rica        02:22 https://mirrors.ucr.ac.cr/manjaro/                            [https] (23) 341.893223ms
S T U Germany           00:02 https://mirror.alpix.eu/manjaro/                              [https] (35) 354.530935ms
S T U France            05:52 https://mirror.oldsql.cc/manjaro/                             [https] (30) 445.801954ms
S T U United_States     04:14 https://mirrors.gigenet.com/manjaro/                          [https http] (89) 459.127037ms
S T U Germany           05:52 https://ftp.halifax.rwth-aachen.de/manjaro/                   [ftp https] (38) 538.25173ms
S T U Indonesia         01:42 https://mirror.deace.id/manjaro/                              [https http] (49) 543.512734ms
S T U United_States     23:51 http://distro.ibiblio.org/manjaro/                            [http] (86) 546.920217ms
S T U Germany           01:49 https://mirror.23media.com/manjaro/                           [https http] (36) 555.13996ms
S T U Colombia          1402:35 http://mirror.upb.edu.co/manjaro/                             [http] (24) 613.991589ms
S T U Denmark           00:02 https://www.uex.dk/public/manjaro/                            [https] (27) 700.78693ms
S T U Greece            00:09 https://ftp.cc.uoc.gr/mirrors/linux/manjaro/                  [ftp http https] (45) 734.166997ms
S T U Poland            00:20 https://mirror.tuchola-dc.pl/manjaro/                         [https http] (65) 793.577624ms
S T U Hong_Kong         12:19 http://ftp.cuhk.edu.hk/pub/Linux/manjaro/                     [ftp http] (46) 808.389424ms
S T U Bangladesh        01:47 http://mirror.xeonbd.com/manjaro/                             [http] (3) 847.432737ms
S T U China             04:42 http://mirrors.tuna.tsinghua.edu.cn/manjaro/                  [http] (20) 926.327454ms
S T U Japan             12:20 http://ftp.tsukuba.wide.ad.jp/Linux/manjaro/                  [http] (57) 944.266601ms
S T U Japan             11:53 http://ftp.riken.jp/Linux/manjaro/                            [ftp http] (56) 1.045949214s
S T U Germany           00:22 http://mirror.ragenetwork.de/manjaro/                         [http] (37) 1.083963333s
S T U Germany           04:39 http://ftp.tu-chemnitz.de/pub/linux/manjaro/                  [ftp http] (39) 1.2115799s
S T U Netherlands       06:53 https://mirror.neostrada.nl/manjaro/                          [ftp http https] (59) 1.21967213s
S T U United_States     00:54 https://repo.ialab.dsu.edu/manjaro/                           [https http] (84) 1.263968162s
S T U South_Africa      01:50 http://mirror.is.co.za/mirrors/manjaro.org/                   [http] (70) 1.295212958s
S T U United_Kingdom    00:54 http://mirror.catn.com/pub/manjaro/                           [http] (80) 1.330496696s
S T U Turkey            05:54 http://ftp.linux.org.tr/manjaro/                              [ftp http] (78) 1.422194102s
S T U Czech             05:52 https://mirror.dkm.cz/manjaro/                                [https] (25) 1.482570456s
S T U Hungary           00:22 https://quantum-mirror.hu/mirrors/pub/manjaro/                [https http] (47) 1.50789174s
S T U Brazil            05:50 http://linorg.usp.br/manjaro/                                 [http] (9) 1.528327071s
S T U Brazil            57:01 http://mirror.ufam.edu.br/manjaro/                            [http] (10) 1.595868626s
S T U Chile             01:18 http://manjaro.dcc.uchile.cl/                                 [http] (16) 1.656361687s
S T U Taiwan            02:41 http://free.nchc.org.tw/manjaro/                              [http] (77) 1.657413376s
S T U Ecuador           03:19 http://mirror.espoch.edu.ec/manjaro/                          [http] (29) 1.796603047s
S T U South_Africa      20:23 http://manjaro.mirror.ac.za/                                  [http ftp] (71) 1.837754697s
S T U United_States     00:14 https://mirror.math.princeton.edu/pub/manjaro/                [https] (88) 1.865768348s
S T U Bulgaria          02:18 http://manjaro.telecoms.bg/                                   [http] (14) 2.02487634s
S T U Ukraine           00:41 http://mirrors.colocall.net/manjaro/                          [http ftp] (79) 2.134301576s
S T U Portugal          05:53 http://ftp.dei.uc.pt/pub/linux/manjaro/                       [http ftp] (67) 2.171536528s
S T U Russia            01:43 http://mirror.truenetwork.ru/manjaro/                         [http] (69) 2.239312909s
S T U Denmark           00:39 https://mirrors.dotsrc.org/manjaro/                           [https] (26) 2.243786567s
S T U France            00:52 http://kibo.remi.lu/                                          [http] (33) 2.25157235s
S T U United_Kingdom    00:14 http://repo.manjaro.org.uk/                                   [http] (81) 2.290847531s
S T U Belarus           01:40 http://mirror.datacenter.by/pub/mirrors/manjaro/              [http] (4) 2.331327375s
S T U France            04:59 http://ftp.free.org/mirrors/repo.manjaro.org/repos/           [ftp http] (32) 2.376364221s
S T U Netherlands       05:53 http://ftp.snt.utwente.nl/pub/linux/manjaro/                  [ftp http] (61) 2.390949837s
S T U Austria           05:50 http://mirror.inode.at/manjaro/                               [http] (1) 2.438286714s
S T U Belgium           00:27 http://mirror.futureweb.be/manjaro/                           [https http] (6) 2.456150882s
S T U United_Kingdom    00:31 http://manjaro.mirrors.uk2.net/                               [http] (83) 2.466662804s
S T U Belgium           81:57 http://ftp.belnet.be/mirrors/manjaro/                         [http ftp] (5) 2.692288859s
S T U Austria           00:20 http://mirror.easyname.at/manjaro/                            [http ftp] (2) 2.757301245s
S T U Germany           00:02 https://manjaro.moson.eu/                                     [http https] (44) -1 [1 1 1]
S T U Italy             05:53 https://manjaro.mirror.garr.it/mirrors/manjaro/               [https] (53) -1 [1 1 1]
S T U Italy             05:53 https://ba.mirror.garr.it/mirrors/manjaro/                    [https] (54) -1 [1 1 1]
S T U Italy             05:53 https://ct.mirror.garr.it/mirrors/manjaro/                    [https] (55) -1 [1 1 1]
S T U Georgia           05:52 https://manjaro.grena.ge/                                     [https http] (34) -1 [1 1 1]
S T U Chile             00:08 https://mirror.ufro.cl/manjaro/                               [https http] (17) -1 [1 1 1]
S T U Kenya             05:53 https://manjaro.mirror.liquidtelecom.com/                     [https http] (58) -1 [1 1 1]
S T U Canada            00:21 https://osmirror.org/manjaro/                                 [https] (15) -1 [1 1 1]
S T U Netherlands       04:23 https://ftp.nluug.nl/pub/os/Linux/distr/manjaro/              [ftp https] (60) -1 [1 1 1]
S T U Iran              11:53 https://repo.iut.ac.ir/repo/manjaro/                          [https http] (52) -1 [1 1 1]
S T U Netherlands       04:20 https://mirror.koddos.net/manjaro/                            [https] (62) -1 [1 1 1]
S T U New_Zealand       00:53 https://manjaro.mirrors.theom.nz/                             [https http] (63) -1 [1 1 1]
S T U Philippines       12:20 http://mirror.rise.ph/manjaro/                                [http ftp] (64) -1 [1 1 1]
S T U Iran              03:29 https://repo.sadjad.ac.ir/manjaro/                            [https http] (50) -1 [1 1 1]
S T U Poland            05:53 http://ftp.vectranet.pl/manjaro/                              [http ftp] (66) -1 [1 1 1]
S T U China             04:41 https://mirrors.huaweicloud.com/manjaro/                      [https http] (18) -1 [1 1 1]
S T U China             07:41 https://mirrors.ustc.edu.cn/manjaro/                          [https] (19) -1 [1 1 1]
S T U Russia            01:43 https://mirror.yandex.ru/mirrors/manjaro/                     [https] (68) -1 [1 1 1]
S T U Bulgaria          00:51 https://manjaro.ipacct.com/manjaro/                           [https] (13) -1 [1 1 1]
S T U Bulgaria          00:21 https://mirrors.netix.net/manjaro/                            [https] (12) -1 [1 1 1]
S T U South_Korea       02:23 http://mirror.d-tl.com/manjaro/                               [http] (72) -1 [1 1 1]
S T U Spain                   https://ftp.caliu.cat/pub/distribucions/manjaro/              [https http ftp] (73) -1 [-1 -1 -1]
S T U Sweden            00:14 https://ftp.lysator.liu.se/pub/manjaro/                       [ftp https] (74) -1 [1 1 1]
S T U Sweden            02:14 https://mirror.zetup.net/manjaro/                             [https] (75) -1 [1 1 1]
S T U Sweden            00:14 https://mirror.operationtulip.com/manjaro/                    [https http] (76) -1 [1 1 1]
S T U Brazil                  http://pet.inf.ufsc.br/mirrors/manjarolinux/                  [http] (8) -1 [-1 -1 -1]
S T U Brazil            01:17 https://manjaro.c3sl.ufpr.br/                                 [https] (7) -1 [1 1 1]
S T U Indonesia               http://kartolo.sby.datautama.net.id/manjaro/                  [http] (48) -1 [-1 -1 -1]
S T U China             04:42 https://mirrors.zju.edu.cn/manjaro/                           [https] (21) -1 [1 1 1]
S T U United_Kingdom    05:01 https://www.mirrorservice.org/sites/repo.manjaro.org/repos/   [https] (82) -1 [1 1 1]
S T U China             01:42 https://mirrors.sjtug.sjtu.edu.cn/manjaro/                    [https] (22) -1 [1 1 1]
S T U Ecuador           01:29 https://mirror.cedia.org.ec/manjaro/                          [https] (28) -1 [1 1 1]
S T U Germany           00:02 https://mirror.philpot.de/manjaro/                            [http https] (43) -1 [1 1 1]
S T U France            00:22 https://manjaro.ynh.ovh/                                      [https] (31) -1 [1 1 1]
S T U United_States           http://mirror.dacentec.com/manjaro/                           [http] (85) -1 [-1 -1 -1]
S T U Germany           04:59 https://mirror.netcologne.de/manjaro/                         [https] (41) -1 [1 1 1]
S T U Germany           00:22 https://mirror.netzspielplatz.de/manjaro/packages/            [https] (40) -1 [1 1 1]
S T U Brazil                  https://www.caco.ic.unicamp.br/manjaro/                       [https http] (11) -1 [-1 -1 -1]
Il y a une coloration syntaxique qui n'apparaît pas ici.
Intéressant :sourire:

[Go] un debut de pacman-mirrors en Go

#3Messageil y a 2 ans

:bjr: Pas mal du tout, merci. :bien

[Go] un debut de pacman-mirrors en Go

#4Messageil y a 2 ans

salut

il n'y a qu'une version de go :wink:

Image

Avec "go run" on ne fait qu'interpréter le script (en fait il compile + execute le binaire dans /tmp/). Pour en faire un (gros) executable c'est go build -ldflags "-s" le_nom_du_script.go - le compilateur va générer un binaire sans l'extension ".go"

@lemust83 en fait il ne fonctionne pas chez toi :mrgreen: le timer est réglé à 3 secondes et ta connexion est tellement lente qu'en 3 secondes il n'a pas le temps de lancer toutes les url : résultat il n'a même pas testé les plus rapides :rigole:

EDIT: nouvelle version : on peut passer le timeout en variable d'environnement (par défaut maintenant c'est 10 et plus 3)

si je passe une valeur très très basse, j'ai comme toi, uniquement 50% des urls qui sont testées chez moi ... (nous n'avons pas la même connexion !)

TIMEOUT=1 ./go-mirrors

------
------

En fait après tests (et surtout résultats de lemust83), je me rends compte que tester la vitesse en asynchrone était une mauvaise idée (fonctionnalité depuis la dernière version de pacmac-mirrors):

Si nous avons un petit débit internet :

Lorsque nous testons la onzième url (serveur très rapide), nous téléchargeons 10 fichiers au même moment et donc la onzième est très lente à cause de notre ligne et pas à cause du serveur :pleure: le classement n'a donc plus aucun sens !

MAIS c'est clairement pas la même vitesse : le même code avec juste un déplacement du chanel pour un travail sync, je passe de 15secondes à 2 minutes :mrgreen:
Pour test, nouvelle version avec une option -n
résultat : avec -n que c'est lent mais résultats constants alors que asynchrone (sans "-n"), les résultats sont presque aléatoires :shock::rigole:

:: run all test :  2m4.168284236s 
S T U France            00:12 https://manjaro.ynh.ovh/                                      [https] (31) 73.769509ms
S T U France            02:12 https://mirror.oldsql.cc/manjaro/                             [https] (30) 75.102205ms
S T U Germany           00:03 https://mirror.philpot.de/manjaro/                            [http https] (43) 77.402815ms
S T U Italy             02:13 https://ct.mirror.garr.it/mirrors/manjaro/                    [https] (55) 82.596174ms

: run all test :  2m21.070828486s 
Sorted:
S T U France            00:12 https://manjaro.ynh.ovh/                                      [https] (31) 72.463111ms
S T U France            02:12 https://mirror.oldsql.cc/manjaro/                             [https] (30) 75.384915ms
S T U Germany           00:03 https://mirror.philpot.de/manjaro/                            [http https] (43) 76.879401ms
S T U Italy             02:13 https://ct.mirror.garr.it/mirrors/manjaro/                    [https] (55) 82.88946ms

:: run all test :  15.334460458s 
S T U France            07:52 https://mirror.oldsql.cc/manjaro/                             [https] (30) 98.090705ms
S T U Belgium           83:58 http://ftp.belnet.be/mirrors/manjaro/                         [http ftp] (5) 118.578916ms
S T U Germany                 http://ftp.rz.tu-bs.de/pub/mirror/manjaro.org/repos/          [ftp http] (42) 131.551589ms
S T U Hungary           00:23 https://quantum-mirror.hu/mirrors/pub/manjaro/                [https http] (47) 139.408583ms

: run all test :  16.460254609s 
S T U Germany           00:03 https://mirror.philpot.de/manjaro/                            [http https] (43) 124.225421ms
S T U Netherlands       00:40 https://mirror.koddos.net/manjaro/                            [https] (62) 127.438631ms
S T U Netherlands       00:43 https://ftp.nluug.nl/pub/os/Linux/distr/manjaro/              [ftp https] (60) 133.315307ms
S T U Russia            01:03 https://mirror.yandex.ru/mirrors/manjaro/                     [https] (68) 154.68231ms
S T U United_Kingdom    00:34 http://repo.manjaro.org.uk/ 
Répondre