Skip to content

Commit

Permalink
+ 中文说明
Browse files Browse the repository at this point in the history
  • Loading branch information
youfou committed Jan 17, 2017
1 parent db84aa4 commit ffe41b1
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 12 deletions.
36 changes: 24 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[中文说明](https://github.com/youfou/mping/blob/master/README_ZHCN.md)

# mping

Ping multiple hosts concurrently and find the fastest to you.
Expand All @@ -10,27 +12,35 @@ Ping multiple hosts concurrently and find the fastest to you.

Just tell which host is the fastest:

mping host1.com host2.com host3.com
```shell
mping host1.com host2.com host3.com
```

Get hosts from a file, and ping them:

mping -p PATH/TO/THE/FILE.txt
```shell
mping -p PATH/TO/THE/FILE.txt
```

> Read **Input File** section below for more details.
The results will be like this:

host | count, loss%, min/avg/max
----------|--------------------------
host1.com | 99, 0.0%, 5.4/6.8/14.1
host2.com | 90, 0.0%, 23.8/33.5/39.5
host3.com | 77, 0.4%, 37.4/39.1/43.6
```
host | count, loss%, min/avg/max
----------|--------------------------
host1.com | 99, 0.0%, 5.4/6.8/14.1
host2.com | 90, 0.0%, 23.8/33.5/39.5
host3.com | 77, 0.4%, 37.4/39.1/43.6
```

> The `count` number represents that how many pings returned to the each host.
> The `count` number represents how many replies returned from each host.
Also Check out the help stuff for more instructions:

mping -h
```shell
mping -h
```

## Input File

Expand All @@ -43,9 +53,11 @@ When use a plain text file, just place each host in a line.

For example:

host1.com
host2.com
host3.com
```
host1.com
host2.com
host3.com
```

**Json File**

Expand Down
84 changes: 84 additions & 0 deletions README_ZHCN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# mping

并发的 ping 多个主机,找出连接最快的。

## 安装方法

pip3 install -U mping

## 使用方法

看看哪个主机最快:

```shell
mping host1.com host2.com host3.com
```

Ping 文件中的主机列表:

```shell
mping -p PATH/TO/THE/FILE.txt
```

> 阅读下方的 **输入文件** 了解过多细节。
结果大概会像这样:

```
host | count, loss%, min/avg/max
----------|--------------------------
host1.com | 99, 0.0%, 5.4/6.8/14.1
host2.com | 90, 0.0%, 23.8/33.5/39.5
host3.com | 77, 0.4%, 37.4/39.1/43.6
```

> `count` 数表示每个主机返回了多少个 ping 回复。
查看说明,了解更多:

```shell
mping -h
```

## 输入文件

可以使用纯文本文件,或 Json 文件,来用于 `-p` / `--path` 参数.


**纯文本文件**

当使用纯文本文件时,只要把每个主机放在单独一行即可。

例如:

```
host1.com
host2.com
host3.com
```

**Json 文件**

你也可以使用一个 Json 文件来作为输入的主机列表,这里有两种模式:

把主机放进一个列表:

```json
[
"host1.com",
"host2.com",
"host3.com"
]
```

把主机放进一个对象(字典),并为主机命名:

```json
{
"S1": "host1.com",
"S2": "host3.com",
"S3": "host3.com"
}
```

> 主机名称将会在结果中被打印出来。

0 comments on commit ffe41b1

Please sign in to comment.