Skip to content

Commit

Permalink
Comment: fixed to be compatible with version 0.27-gfm
Browse files Browse the repository at this point in the history
  • Loading branch information
vozlt committed Mar 21, 2017
1 parent a9a0791 commit e512897
Showing 1 changed file with 55 additions and 55 deletions.
110 changes: 55 additions & 55 deletions README.md
Expand Up @@ -16,13 +16,13 @@ Table of Contents
* [Description](#description)
* [Embedded Variables](#embedded-variables)
* [Directives](#directives)
* [sysguard](#sysguard)
* [sysguard_load](#sysguard_load)
* [sysguard_mem](#sysguard_mem)
* [sysguard_rt](#sysguard_rt)
* [sysguard_mode](#sysguard_mode)
* [sysguard_interval](#sysguard_interval)
* [sysguard_log_level](#sysguard_log_level)
* [sysguard](#sysguard)
* [sysguard_load](#sysguard_load)
* [sysguard_mem](#sysguard_mem)
* [sysguard_rt](#sysguard_rt)
* [sysguard_mode](#sysguard_mode)
* [sysguard_interval](#sysguard_interval)
* [sysguard_log_level](#sysguard_log_level)
* [See Also](#see-also)
* [TODO](#todo)
* [Donation](#donation)
Expand Down Expand Up @@ -141,110 +141,110 @@ This is a porting version of the [sysguard](http://tengine.taobao.org/document/h
The following embedded variables are provided:

* **$sysguard_load**
* The load of system. If `$sysguard_load`'s value is 100, then load is 0.1(100/1000). (/msec)
* The load of system. If `$sysguard_load`'s value is 100, then load is 0.1(100/1000). (/msec)
* **$sysguard_swapstat**
* The ratio of using swap. (/per)
* The ratio of using swap. (/per)
* **$sysguard_free**
* The real free space of memory. (/byte)
* The real free space of memory. (/byte)
* **$sysguard_rt**
* The average of request processing times. If `$sysguard_rt`'s value is 100, then response time is 0.1sec(100/1000). (/msec)
* The average of request processing times. If `$sysguard_rt`'s value is 100, then response time is 0.1sec(100/1000). (/msec)
* **$sysguard_meminfo_totalram**
* The total memory of meminfo. (/byte)
* The total memory of meminfo. (/byte)
* **$sysguard_meminfo_freeram**
* The free memory of meminfo. (/byte)
* The free memory of meminfo. (/byte)
* **$sysguard_meminfo_bufferram**
* The buffer memory of meminfo. (/byte)
* The buffer memory of meminfo. (/byte)
* **$sysguard_meminfo_cachedram**
* The cached memory of meminfo. (/byte)
* The cached memory of meminfo. (/byte)
* **$sysguard_meminfo_totalswap**
* The total swap of meminfo. (/byte)
* The total swap of meminfo. (/byte)
* **$sysguard_meminfo_freeswap**
* The free swap of meminfo. (/byte)
* The free swap of meminfo. (/byte)


## Directives

### sysguard

- | -
--- | ---
**Syntax** | **sysguard** \<on\|off\>
**Default** | off
**Context** | http, server, location
| - | - |
| --- | --- |
| **Syntax** | **sysguard** \<on\|off\> |
| **Default** | off |
| **Context** | http, server, location |

`Description:` Enables or disables the module working.

### sysguard_load

- | -
--- | ---
**Syntax** | **sysguard_load** load=*number* [action=*/url*]
**Default** | -
**Context** | http, server, location
| - | - |
| --- | --- |
| **Syntax** | **sysguard_load** load=*number* [action=*/url*] |
| **Default** | - |
| **Context** | http, server, location |

`Description:` Specify the load threshold. When the system load exceeds this threshold, all subsequent requests will be redirected to the URL specified by the 'action' parameter. It will return 503 if there's no 'action' URL defined. This directive also support using ncpuratio to instead of the fixed threshold, 'ncpu' means the number of cpu's cores, you can use this directive like this: load=ncpu1.5

### sysguard_mem

- | -
--- | ---
**Syntax** | **sysguard_mem** swapratio=*ratio*% free=*size* [action=*/url*]
**Default** | -
**Context** | http, server, location
| - | - |
| --- | --- |
| **Syntax** | **sysguard_mem** swapratio=*ratio*% free=*size* [action=*/url*] |
| **Default** | - |
| **Context** | http, server, location |

`Description:` Specify the used swap memory or free memory threshold. When the swap memory use ratio exceeds this threshold or memory free less than the size, all subsequent requests will be redirected to the URL specified by the 'action' parameter. It will return 503 if there's no 'action' URL. Sysguard uses this strategy to calculate memory free: "memfree = free + buffered + cached"

### sysguard_rt

- | -
--- | ---
**Syntax** | **sysguard_rt** rt=*second* period=*time* [method=\<AMM\|WMA\>:*number*] [action=*/url*]
**Default** | -
**Context** | http, server, location
| - | - |
| --- | --- |
| **Syntax** | **sysguard_rt** rt=*second* period=*time* [method=\<AMM\|WMA\>:*number*] [action=*/url*] |
| **Default** | - |
| **Context** | http, server, location |

`Description:` Specify the response time threshold.
Parameter rt is used to set a threshold of the average response time, in second.
Parameter period is used to specifiy the period of the statistics cycle.
If the average response time of the system exceeds the threshold specified by the user,
the incoming request will be redirected to a specified url which is defined by parameter 'action'.
If no 'action' is presented, the request will be responsed with 503 error directly.
The `method` is a fomula that calculate the average of response processing times.
The `method` is a formula that calculate the average of response processing times.
The `number` in method is the number of samples to calculate the average.
The default method is set to be `method=AMM:period`.

* **AMM**
* The AMM is the [arithmetic mean](https://en.wikipedia.org/wiki/Arithmetic_mean).
* The AMM is the [arithmetic mean](https://en.wikipedia.org/wiki/Arithmetic_mean).
* **WMA**
* THE WMA is the [weighted moving average](https://en.wikipedia.org/wiki/Moving_average#Weighted_moving_average).
* THE WMA is the [weighted moving average](https://en.wikipedia.org/wiki/Moving_average#Weighted_moving_average).

### sysguard_mode

- | -
--- | ---
**Syntax** | **sysguard_mode** \<and\|or\>
**Default** | or
**Context** | http, server, location
| - | - |
| --- | --- |
| **Syntax** | **sysguard_mode** \<and\|or\> |
| **Default** | or |
| **Context** | http, server, location |

`Description:` If there are more than one type of monitor, this directive is used to specified the relations among all the monitors which are: 'and' for all matching and 'or' for any matching.

### sysguard_interval

- | -
--- | ---
**Syntax** | **sysguard_interval** *time*
**Default** | 1s
**Context** | http, server, location
| - | - |
| --- | --- |
| **Syntax** | **sysguard_interval** *time* |
| **Default** | 1s |
| **Context** | http, server, location |

`Description:` Specify the time interval to update your system information.
The default value is one second, which means sysguard updates the server status once a second.

### sysguard_log_level

- | -
--- | ---
**Syntax** | **sysguard_log_level** \<info\|notice\|warn\|error\>
**Default** | error
**Context** | http, server, location
| - | - |
| --- | --- |
| **Syntax** | **sysguard_log_level** \<info\|notice\|warn\|error\> |
| **Default** | error |
| **Context** | http, server, location |

`Description:` Specify the log level of sysguard.

Expand Down

0 comments on commit e512897

Please sign in to comment.