changed to pro-bing
This commit is contained in:
@@ -2,7 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/go-ping/ping"
|
||||
"github.com/prometheus-community/pro-bing"
|
||||
"math"
|
||||
"time"
|
||||
)
|
||||
@@ -12,7 +12,7 @@ const (
|
||||
PingInterval = 5
|
||||
)
|
||||
|
||||
func formatLine(stats *ping.Statistics) {
|
||||
func formatLine(stats *probing.Statistics) {
|
||||
if stats.PacketLoss >= 100.0 {
|
||||
// fontawesome/forkawesome doesn't have the fitting icon...
|
||||
// so this is the utf-8 icon/emoji
|
||||
@@ -52,7 +52,7 @@ func main() {
|
||||
for {
|
||||
time.Sleep(time.Duration(PingInterval) * time.Second)
|
||||
|
||||
pinger, err := ping.NewPinger("itsh.dev")
|
||||
pinger, err := probing.NewPinger("itsh.dev")
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
continue
|
||||
|
Reference in New Issue
Block a user