Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( COUNT = 5 TIMEOUT = 800 * time.Millisecond INTERVAL = 100 * time.Millisecond HOP_SLEEP = time.Nanosecond MAX_HOPS = 64 MAX_UNKNOWN_HOPS = 10 RING_BUFFER_SIZE = 50 PTR_LOOKUP = false )
View Source
var RootCmd = &cobra.Command{ Use: "mtr TARGET", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { if versionFlag { fmt.Printf("MTR Version: %s, build date: %s\n", version, date) return nil } m, ch, err := mtr.NewMTR(args[0], srcAddr, TIMEOUT, INTERVAL, HOP_SLEEP, MAX_HOPS, MAX_UNKNOWN_HOPS, RING_BUFFER_SIZE, PTR_LOOKUP) if err != nil { return err } if jsonFmt { go func(ch chan struct{}) { for { <-ch } }(ch) m.Run(ch, COUNT) s, err := pj.Marshal(m) if err != nil { return err } fmt.Println(string(s)) return nil } fmt.Println("Start:", time.Now()) tm.Clear() mu := &sync.Mutex{} go func(ch chan struct{}) { for { mu.Lock() <-ch render(m) mu.Unlock() } }(ch) m.Run(ch, COUNT) close(ch) mu.Lock() render(m) mu.Unlock() return nil }, }
rootCmd represents the root command
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.