Skip to content

Commit d3d7273

Browse files
Версия 1.0.49 - добавлен цветной режим
1 parent d57a855 commit d3d7273

File tree

5 files changed

+26
-7
lines changed

5 files changed

+26
-7
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# ChangeLog
22

3+
@ 2022-05-04, v1.0.49
4+
5+
* Добавлен вывод информации и сообщений в цветном режиме
6+
37
@ 2022-05-04, v1.0.48
48

59
* Переделан порядок инициализации переменных из командной строки

README.en.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ You need to put these files in one directory: `bench.php`, `common.inc`, `php5.i
3636

3737
Command:
3838
```
39-
Usage: bench.php [-h|--help] [-x|--debug] [-J|--print-json] [-M|--print-machine] [-d|--dont-recalc] [-D|--dumb-test-print] [-L|--list-tests] [-I|--system-info] [-S|--do-not-task-set] [-m|--memory-limit=130] [-t|--time-limit=600] [-T|--run-test=name1 ...]
39+
Usage: bench.php [-h|--help] [-x|--debug] [-C|--dont-use-colors] [-J|--print-json] [-M|--print-machine] [-d|--dont-recalc] [-D|--dumb-test-print] [-L|--list-tests] [-I|--system-info] [-S|--do-not-task-set] [-m|--memory-limit=130] [-t|--time-limit=600] [-T|--run-test=name1 ...]
4040
4141
-h|--help - print this help and exit
4242
-x|--debug - enable debug mode, raise output level
43+
-C|--dont-use-colors - disable printing html-span or color sequences for capable terminal: xterm, *-color, *-256color. And not in JSON/machine mode.
4344
-J|--print-json - enable printing only in JSON format, useful for automated tests. disables print-machine.
4445
-M|--print-machine - enable printing only in machine parsable format, useful for automated tests. disables print-json.
4546
-d|--dont-recalc - do not recalculate test times / operations count even if memory of execution time limits are low
@@ -59,8 +60,9 @@ env PHP_MEMORY_LIMIT=64 PHP_TIME_LIMIT=30 php bench.php
5960

6061
Available variables:
6162

62-
- PHP_TIME_LIMIT=<Секунды>
63+
- PHP_TIME_LIMIT=<Seconds>
6364
- PHP_DEBUG_MODE=0/1
65+
- DONT_USE_COLORS=0/1
6466
- PRINT_JSON=0/1
6567
- PRINT_MACHINE=0/1
6668
- PHP_MEMORY_LIMIT=<Мб>
@@ -88,6 +90,7 @@ Available options:
8890

8991
- time_limit=Секунды
9092
- debug_mode=0/1
93+
- dont_use_colors=0/1
9194
- print_json=0/1
9295
- print_machine=0/1
9396
- memory_limit=Мб
@@ -244,3 +247,8 @@ TEST_NAME: SECONDS, OP/SEC, OP/SEC/MHz, MEMORY
244247
33_phpinfo_generate: 3.6759581565857, 2720.3791702809, 0.75566088063359, 4194304
245248
TOTAL: 7.0567882061005, 284832.12777484, 79.120035493011
246249
```
250+
251+
### In web-browser
252+
253+
Link like: http://sergey.home.lan/bench/bench.php?system_info=1
254+
![System information](browser.png "System information")

README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@
3636

3737
Команда:
3838
```
39-
Usage: bench.php [-h|--help] [-x|--debug] [-J|--print-json] [-M|--print-machine] [-d|--dont-recalc] [-D|--dumb-test-print] [-L|--list-tests] [-I|--system-info] [-S|--do-not-task-set] [-m|--memory-limit=130] [-t|--time-limit=600] [-T|--run-test=name1 ...]
39+
Usage: bench.php [-h|--help] [-x|--debug] [-C|--dont-use-colors] [-J|--print-json] [-M|--print-machine] [-d|--dont-recalc] [-D|--dumb-test-print] [-L|--list-tests] [-I|--system-info] [-S|--do-not-task-set] [-m|--memory-limit=130] [-t|--time-limit=600] [-T|--run-test=name1 ...]
4040
4141
-h|--help - print this help and exit
4242
-x|--debug - enable debug mode, raise output level
43+
-C|--dont-use-colors - disable printing html-span or color sequences for capable terminal: xterm, *-color, *-256color. And not in JSON/machine mode.
4344
-J|--print-json - enable printing only in JSON format, useful for automated tests. disables print-machine.
4445
-M|--print-machine - enable printing only in machine parsable format, useful for automated tests. disables print-json.
4546
-d|--dont-recalc - do not recalculate test times / operations count even if memory of execution time limits are low
@@ -61,6 +62,7 @@ env PHP_MEMORY_LIMIT=64 PHP_TIME_LIMIT=30 php bench.php
6162

6263
- PHP_TIME_LIMIT=<Секунды>
6364
- PHP_DEBUG_MODE=0/1
65+
- DONT_USE_COLORS=0/1
6466
- PRINT_JSON=0/1
6567
- PRINT_MACHINE=0/1
6668
- PHP_MEMORY_LIMIT=<Мб>
@@ -88,6 +90,7 @@ env PHP_MEMORY_LIMIT=64 PHP_TIME_LIMIT=30 php bench.php
8890

8991
- time_limit=Секунды
9092
- debug_mode=0/1
93+
- dont_use_colors=0/1
9194
- print_json=0/1
9295
- print_machine=0/1
9396
- memory_limit=Мб
@@ -245,3 +248,8 @@ TEST_NAME: SECONDS, OP/SEC, OP/SEC/MHz, MEMORY
245248
33_phpinfo_generate: 3.6759581565857, 2720.3791702809, 0.75566088063359, 4194304
246249
TOTAL: 7.0567882061005, 284832.12777484, 79.120035493011
247250
```
251+
252+
### В браузере
253+
254+
Ссылка вида: http://sergey.home.lan/bench/bench.php?system_info=1
255+
![Информация о системе](browser.png "Информация о системе")

bench.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
# Company : Code24 BV, The Netherlands #
1010
# Author : Sergey Dryabzhinsky #
1111
# Company : Rusoft Ltd, Russia #
12-
# Date : May 03, 2022 #
13-
# Version : 1.0.49-dev #
12+
# Date : May 04, 2022 #
13+
# Version : 1.0.49 #
1414
# License : Creative Commons CC-BY license #
1515
# Website : https://github.com/rusoft/php-simple-benchmark-script #
1616
# Website : https://git.rusoft.ru/open-source/php-simple-benchmark-script #
1717
# #
1818
################################################################################
1919
*/
2020

21-
$scriptVersion = '1.0.49-dev';
21+
$scriptVersion = '1.0.49';
2222

2323
// Special string to flush buffers, nginx for example
2424
$flushStr = '<!-- '.str_repeat(" ", 8192).' -->';
@@ -1688,4 +1688,3 @@ function print_results_json()
16881688
} else {
16891689
print_results_common();
16901690
}
1691-

browser.png

43.5 KB
Loading

0 commit comments

Comments
 (0)