mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-25 23:11:02 +08:00
translated
This commit is contained in:
parent
a124d126b1
commit
d8838e1181
@ -1,78 +0,0 @@
|
||||
Translating-----geekpi
|
||||
|
||||
tespeed - Python Tool To Test Your Internet Speed
|
||||
================================================================================
|
||||
Many computer nerds know how to test their internet speed by using the **speedtest.net** but the thing is that it does not give you full control of the operationg going on during the measurement of your speed. Linux users love to type commands on their terminal emualator and do stuff, at least me.
|
||||
|
||||
The tespeed tool is a python tool with many features that helps to test network speed from the terminal. According to the documentation it makes use of nearest speedtest.net server but the users can also manually specify one.
|
||||
|
||||
In the beginning the author wrote the tespeed tool in the php programming language and proved to the ISP he was working for at that time that the internet they served was far from what they advertised. But things were not working all the time as they supposed to be so the author ported his php scripts to python and his tool counts 180 stars on github.
|
||||
|
||||
It means **alot**.
|
||||
|
||||
### How to use tespeed on linux ###
|
||||
|
||||
Before running a python application on your machine you have to make sure that the system you are working meets the dependencies required by the tool. The python tool tespeed dependes on the two following python packages:
|
||||
|
||||
- lxml
|
||||
- SocksiPy
|
||||
|
||||
You can easily install lxml with the help of the pip python package management system and to do that run the following command.
|
||||
|
||||
pip install lxml
|
||||
|
||||
Now we have to perform a simple trick to make use of the SocksiPy which you can download by using the the following command like shown below.
|
||||
|
||||
wget http://sourceforge.net/projects/socksipy/files/socksipy/SocksiPy%201.00/SocksiPy.zip/
|
||||
|
||||
Once the installation is finished unzip **SocksiPy.zip** and run the following command to clone tespeed repo on your local machine.
|
||||
|
||||
git clone https://github.com/Janhouse/tespeed.git
|
||||
|
||||
Then place the SocksiPy folder inside the tespeed project you cloned. Now we have to create an empety file inside the SocksiPy folder under the name of **__init__.py** like shown in the following screenshot.
|
||||
|
||||
![simple trick to make tespeed work](http://blog.linoxide.com/wp-content/uploads/2015/01/tespeed1.png)
|
||||
|
||||
Now that we have fixed the dependencies for out projet we can easily run it by using the following command.
|
||||
|
||||
python tespeed.py
|
||||
|
||||
Then some magic is going to happen. The application is going to test your download and upload speed and display them in your console using some really nice colors.
|
||||
|
||||
![testing download and upload speed with tespeed python application](http://blog.linoxide.com/wp-content/uploads/2015/01/tespeed2.png)
|
||||
|
||||
There are many commands available in tespeed such as the option **-ls** to list the servers, option **-p** to specify and use a proxy server, the option **-s** to suppress debugging (STDERR) output and many others that we will explore in this tutorial.
|
||||
|
||||
For example if you want to display results in mebibits you need to use the command **python tespeed.py** followed by the option **-mib**
|
||||
|
||||
python tespeed.py -mib
|
||||
|
||||
You can easily see how the unit used for measurement of the internet speed changed after using the tespeed app with the option -mib.
|
||||
|
||||
![testing internet speed with tespeed python application](http://blog.linoxide.com/wp-content/uploads/2015/01/tespeed3.png)
|
||||
|
||||
A very nice useful option I like to use while working with tespeed is the option -w which can be used to print CSV formated output to STDOUT.
|
||||
|
||||
python tespeed.py -w
|
||||
|
||||
Use the following command to list the servers.
|
||||
|
||||
python tespeed -ls
|
||||
|
||||
After running the above command you will get a list of servers used to test your upload and download speed. My list is really long so I am not going to share it in this tutorial.
|
||||
|
||||
### Conclusion ###
|
||||
|
||||
tespeed is a really easy to use high performance python script that helps computer users to test their upload and download speed by typing commands on their terminal. It supports many options and also you can specify the list of servers you would like to use. Keep playing with tespeed and please share your experience with us in the comment section.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/tools/tespeed-python-tool-test-internet-speed/
|
||||
|
||||
作者:[Oltjano Terpollari][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/oltjano/
|
@ -0,0 +1,76 @@
|
||||
tespeed - 测试网速的Python工具
|
||||
================================================================================
|
||||
许多电脑呆子知道可以用**speedtest.net**测试网速,但是这个不能在测试中给你足够的控制。Linux用户喜欢在终端中输入命令来完成任务,至少对我是这样的。
|
||||
|
||||
tespeed是一款有很多特性的python工具,可以在终端在测试网速。根据文档,它利用了speedtest.net的服务器,但是用户可以手动指定。
|
||||
|
||||
最初作者用php语言写了tespeed工具,并且证明了ISP提供的网络远低于它广告中所说的那样。但是事情并不是一直如它们想的那样,因此作者移植他的php脚本到python中并且他的工具在github中已经有180个star了。
|
||||
|
||||
这意味着**alot**。
|
||||
|
||||
### 如何在linux中测试tespeed ###
|
||||
|
||||
在你电脑上运行这个python程序前先确保系统已经满足了这个工具的依赖。tespeed依赖下面两个包:
|
||||
|
||||
- lxml
|
||||
- SocksiPy
|
||||
|
||||
你可以用pip包管理系统来安装lxml,只要用下面的命令就行。
|
||||
|
||||
pip install lxml
|
||||
|
||||
现在我们需要输入下面的命令来下载安装SocksiPy。
|
||||
|
||||
wget http://sourceforge.net/projects/socksipy/files/socksipy/SocksiPy%201.00/SocksiPy.zip/
|
||||
|
||||
下载完成后 解压**SocksiPy.zip**病运行下面的命令来克隆tespeed仓库到你本地机器中。
|
||||
|
||||
git clone https://github.com/Janhouse/tespeed.git
|
||||
|
||||
接着把SocksiPy文件夹放到你克隆下来的tespeed项目中。现在我们要像截图那样在SocksPy中的**__init__.py**下面创建一个空文件。
|
||||
|
||||
![simple trick to make tespeed work](http://blog.linoxide.com/wp-content/uploads/2015/01/tespeed1.png)
|
||||
|
||||
现在我们已经解决了项目的依赖问题,我们可以用下面的命令运行了。
|
||||
|
||||
python tespeed.py
|
||||
|
||||
接下来就会发生一些神奇的事了。程序会测试你的下载和上传速度并且在你的终端中用漂亮的颜色显示出来。
|
||||
|
||||
![testing download and upload speed with tespeed python application](http://blog.linoxide.com/wp-content/uploads/2015/01/tespeed2.png)
|
||||
|
||||
在tespeed中有很多选项,如**-ls**来现实服务器,**-p**来指定代理服务器, **-s**来阻止调试(STDERR)输出, 还有很多我们会在本教程中探索。
|
||||
|
||||
如果你想要结果现实成MB,你可以在**python tespeed.py** 后面接上选项 **-mib**。
|
||||
|
||||
python tespeed.py -mib
|
||||
|
||||
在你使用了-mib选项后你可以看到计量网速的单位改变了。
|
||||
|
||||
![testing internet speed with tespeed python application](http://blog.linoxide.com/wp-content/uploads/2015/01/tespeed3.png)
|
||||
|
||||
我非常喜欢用的一个选项是-w,它可以把标准输出转化成CSV格式。
|
||||
|
||||
python tespeed.py -w
|
||||
|
||||
使用下面的命令来列出服务器。
|
||||
|
||||
python tespeed -ls
|
||||
|
||||
运行上面的命令后,你会看到可以用于测试上传和下载速度的服务器列表。我的列表非常长,所以我不会在教程中共享了。
|
||||
|
||||
### 总结 ###
|
||||
|
||||
=tespeed的确是一款帮助用户在终端中测试上传和下载速度的高性能python脚本。它支持很多的选项并且你可以指定列表中你想使用的服务器。继续使用tespeed并在留言区写下你们的体验吧。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/tools/tespeed-python-tool-test-internet-speed/
|
||||
|
||||
作者:[Oltjano Terpollari][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/oltjano/
|
Loading…
Reference in New Issue
Block a user