changed to pro-bing

This commit is contained in:
2023-04-14 19:40:30 +02:00
parent ca36f69787
commit c80cc7a6f5
3 changed files with 6 additions and 14 deletions

View File

@@ -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