GithubHelp home page GithubHelp logo

goping's Introduction

go simple ping

go APM GitHub release GitHub All Releases

简介

  1. 提供可视化的网络实时状况展示
  2. gui界面提供灵活的软件配置
    • 可通过json配置测试主机列表
    • 可通过json配置各项参数
  3. 提供一大堆go实现高效ping(支持多个ping并发)

预览

安装

  • 需要调用ping接口或改造gui

    使用go get工具进行安装源码

    go get github.com/intmian/goping
  • 只需gui工具的话,下载gui可执行文件go gui

issue

请提出宝贵意见 issue

使用

依赖

gui依赖于Gonum Plot

使用go get工具进行安装源码

go get gonum.org/v1/plot/...

引入

import "github.com/intmian/goping"

接口

  • Ping(host string, c chan int, count int, size int, timeout int64, neverStop bool)

    • host 主机号

    • count 一次发送几个包

    • size 包大小

    • timeout 时间

    • neverStop 是否为永久的ping(一直ping,直到ctrl + c终止)

    • done chan bool
      go Ping(host, done, count, timeout, neverStop)
      <-done
    • 会输出标准的ping信息(和系统自带的ping一样)

  • SimplePing(host string, c chan int)

    • func SimplePing(host string, c chan int) {
      	Ping(host, c, 4, 32, 1000, false)
      }
  • PingInfo

    • type PingInfo struct {
      	Average  float32
      	LostRate float32
      }
      
  • PingInside(host string, c chan PingInfo, count int, size int, timeout int64, neverStop bool)

    • 和之前的ping一样,不过数据以PingInfo形式输出

    • data chan bool
      go Ping_inside(host, data, count, timeout, neverStop)
      temp := <-data
      print(temp.Average)
      print(temp.LostRate)
  • PingInsideSimple(host string, c chan PingInfo)

    • func Ping_inside_simple(host string, c chan PingInfo) {
      	Ping_inside(host, c, 4, 32, 1000, false)
      }
  • Gui()

    • 以gui形式显示网络状况,从运行目录中读取 setting.jsonhosts.json 中的配置。ctrl + c 结束后保存图片到根目录的 avg.pnglost_rate.png

    • Gui()
    • 配置文件样本

      • setting.json

        {
          "sleepTime" : 10,
          "repaintTime" : 0.5,
          "count" : 5
        }
      • hosts.json

        [
          "www.baidu.com",
          "www.intmian.com"
        ]

goping's People

Contributors

intmian avatar

Stargazers

PixMaew avatar  avatar Coder-lkl avatar ObjectNotFound avatar Lou00 avatar  avatar

goping's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.