Skip to content

Commit

Permalink
fix spelling mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
catscarlet committed Oct 19, 2015
1 parent 8e939de commit 70f6f74
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions README.md
Expand Up @@ -3,25 +3,25 @@

_Click here for Chinese README.[中文文档](https://github.com/catscarlet/cpustat/blob/master/README_zh-cn.md)_

A very simple cpu usage percentages monitor tools for linux. Simply calculate and output cpu usage percentages in text. Two versions coding by shell and php.
A very simple CPU usage percentages monitor tools for Linux. Simply calculate and output CPU usage percentages in text. Two versions coding by Shell and PHP.

###The reason why I made this

_(You can skip this phase. This is just my complaint)_

Nowadays there are a lot of tools that can collect, report, or save percentage of CPU time. They are very powerful because they can record cpu performance and save log, or they have a good readability with a GUI, such as sar and nmon.
Nowadays there are a lot of tools that can collect, report, or save percentage of CPU time. They are very powerful because they can record CPU performance and save log, or they have a good readability with a GUI, such as `sar` and `nmon`.

But I didn't find a tool which can simply output a percentage of cpu time.
But I didn't find a tool which can simply output a percentage of CPU time.

Earlier I wrote a system status monitor, so I need to find some tools to monitor the usage of cpu, memory and disk. I chose 'free' and 'df' to watch memory and disk. However, I couldn't find a simple tool to monitor cpu. I tried top and found it couldn't unfold cpu without interactive mode. Similarly found sar only record log and nmon only work in interactive mode.
Earlier I wrote a system status monitor, so I need to find some tools to monitor the usage of CPU, memory and disk. I chose `free` and `df` to watch memory and disk. However, I couldn't find a simple tool to monitor CPU. I tried top and found it couldn't unfold CPU without interactive mode. Similarly found `sar` only record log and `nmon` only work in interactive mode.

Even though they are powerful tools, and maybe they have a mode to output a simple or complex output, I only need a very simple tool to output a simple value of cpu usage, no need of history log, no need of interactive mode.
Even though they are powerful tools, and maybe they have a mode to output a simple or complex output, I only need a very simple tool to output a simple value of CPU usage, no need of history log, no need of interactive mode.

So I decided to write a tool to make myself satisfied.

Note :
- This project use 'cat /proc/stat' to collect information, using regex, so only work with Linux 2.6.24 and newer version because there are 9 columns. See in:[http://www.linuxhowtos.org/System/procstat.htm](http://www.linuxhowtos.org/System/procstat.htm)
- Because Bash doesn't support floating calculation, so there is only integer %. I don't want to use bc to support floating calculation, because there is no need of such exact computation.
- This project uses `cat /proc/stat` to collect information, using regex, so it only works with Linux 2.6.24 and newer version because there are 9 columns. See in:[http://www.linuxhowtos.org/System/procstat.htm](http://www.linuxhowtos.org/System/procstat.htm)
- Because Bash doesn't support floating calculation, so there is only integer %. I don't want to use `bc` to support floating calculation, because there is no need of such exact computation.

##Install

Expand All @@ -31,7 +31,7 @@ Just copy files to your destination computer. Give bash_cpustat.sh execute permi

###PHP

Run php_cpustat.php in php-cli, or open it in brower (need http service):
Run php_cpustat.php in php-cli, or open it in browser (need http service):

####php-cli

Expand All @@ -51,9 +51,9 @@ php php_cpustat.php a

![php php_cpustat.php level=-a](https://raw.githubusercontent.com/catscarlet/cpustat/master/snapshot/php_cpustat_a_a.png)

####brower
####browser

You can open php_cpustat.php in brower. Try to use curl easily:
You can open php_cpustat.php in browser. Try to use curl easily:

```
curl http://localhost/cpustat/php_cpustat.php
Expand All @@ -63,9 +63,9 @@ curl http://localhost/cpustat/php_cpustat.php

![curl php_cpustat.php level=a](https://raw.githubusercontent.com/catscarlet/cpustat/master/snapshot/php_cpustat_a_curl.png)

php_cpustat.php don't support parameter in brower yet.You need to change the default output level instead.
php_cpustat.php don't support parameter in browser yet. You need to change the default output level instead.

**Notice:** If you open php_cpustat.php in brower, the output may seem in a mess because the it use LF for newline, not CRLF.
**Notice:** If you open php_cpustat.php in browser, the output may seem in a mess because the it use LF for newline, not CRLF.

**Notice:** If you want to change the default output level, edit the file and change the value of **$inforlevel = 'a';**

Expand Down

0 comments on commit 70f6f74

Please sign in to comment.