Skip to content

Commit df740c3

Browse files
authored
Add command-benchmark component (#844)
* Add `command-benchmark` component * feat: add default case to command output formatting --------- Co-authored-by: Deeka Wong <8337659+huangdijia@users.noreply.github.com>
1 parent 2a42a57 commit df740c3

13 files changed

Lines changed: 240 additions & 6 deletions

File tree

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
"replace": {
115115
"friendsofhyperf/amqp-job": "*",
116116
"friendsofhyperf/cache": "*",
117+
"friendsofhyperf/command-benchmark": "*",
117118
"friendsofhyperf/command-signals": "*",
118119
"friendsofhyperf/command-validation": "*",
119120
"friendsofhyperf/compoships": "*",
@@ -168,6 +169,7 @@
168169
"psr-4": {
169170
"FriendsOfHyperf\\AmqpJob\\": "src/amqp-job/src/",
170171
"FriendsOfHyperf\\Cache\\": "src/cache/src/",
172+
"FriendsOfHyperf\\CommandBenchmark\\": "src/command-benchmark/src/",
171173
"FriendsOfHyperf\\CommandSignals\\": "src/command-signals/src/",
172174
"FriendsOfHyperf\\CommandValidation\\": "src/command-validation/src/",
173175
"FriendsOfHyperf\\Compoships\\": "src/compoships/src/",
@@ -253,6 +255,7 @@
253255
"config": [
254256
"FriendsOfHyperf\\AmqpJob\\ConfigProvider",
255257
"FriendsOfHyperf\\Cache\\ConfigProvider",
258+
"FriendsOfHyperf\\CommandBenchmark\\ConfigProvider",
256259
"FriendsOfHyperf\\CommandSignals\\ConfigProvider",
257260
"FriendsOfHyperf\\CommandValidation\\ConfigProvider",
258261
"FriendsOfHyperf\\Compoships\\ConfigProvider",
@@ -303,7 +306,7 @@
303306
"cs-fix": "@php vendor/bin/php-cs-fixer fix $1 --verbose",
304307
"gen:readme": [
305308
"./bin/regenerate-readme.sh > src/.github/profile/README.md",
306-
"./bin/regenerate-readme.sh > docs/zh_CN/guide/start/components.md"
309+
"./bin/regenerate-readme.sh > docs/zh-cn/guide/start/components.md"
307310
],
308311
"json-fix": [
309312
"@php ./bin/composer-json-fixer",

docs/zh-cn/guide/start/components.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
|--|--|--|--|
77
|[amqp-job](https://github.com/friendsofhyperf/amqp-job)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/amqp-job/v)](https://packagist.org/packages/friendsofhyperf/amqp-job)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/amqp-job/downloads)](https://packagist.org/packages/friendsofhyperf/amqp-job)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/amqp-job/d/monthly)](https://packagist.org/packages/friendsofhyperf/amqp-job)|
88
|[cache](https://github.com/friendsofhyperf/cache)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/cache/v)](https://packagist.org/packages/friendsofhyperf/cache)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/cache/downloads)](https://packagist.org/packages/friendsofhyperf/cache)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/cache/d/monthly)](https://packagist.org/packages/friendsofhyperf/cache)|
9+
|[command-benchmark](https://github.com/friendsofhyperf/command-benchmark)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/command-benchmark/v)](https://packagist.org/packages/friendsofhyperf/command-benchmark)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/command-benchmark/downloads)](https://packagist.org/packages/friendsofhyperf/command-benchmark)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/command-benchmark/d/monthly)](https://packagist.org/packages/friendsofhyperf/command-benchmark)|
910
|[command-signals](https://github.com/friendsofhyperf/command-signals)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/command-signals/v)](https://packagist.org/packages/friendsofhyperf/command-signals)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/command-signals/downloads)](https://packagist.org/packages/friendsofhyperf/command-signals)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/command-signals/d/monthly)](https://packagist.org/packages/friendsofhyperf/command-signals)|
1011
|[command-validation](https://github.com/friendsofhyperf/command-validation)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/command-validation/v)](https://packagist.org/packages/friendsofhyperf/command-validation)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/command-validation/downloads)](https://packagist.org/packages/friendsofhyperf/command-validation)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/command-validation/d/monthly)](https://packagist.org/packages/friendsofhyperf/command-validation)|
1112
|[compoships](https://github.com/friendsofhyperf/compoships)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/compoships/v)](https://packagist.org/packages/friendsofhyperf/compoships)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/compoships/downloads)](https://packagist.org/packages/friendsofhyperf/compoships)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/compoships/d/monthly)](https://packagist.org/packages/friendsofhyperf/compoships)|

src/.github/profile/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
|--|--|--|--|
77
|[amqp-job](https://github.com/friendsofhyperf/amqp-job)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/amqp-job/v)](https://packagist.org/packages/friendsofhyperf/amqp-job)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/amqp-job/downloads)](https://packagist.org/packages/friendsofhyperf/amqp-job)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/amqp-job/d/monthly)](https://packagist.org/packages/friendsofhyperf/amqp-job)|
88
|[cache](https://github.com/friendsofhyperf/cache)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/cache/v)](https://packagist.org/packages/friendsofhyperf/cache)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/cache/downloads)](https://packagist.org/packages/friendsofhyperf/cache)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/cache/d/monthly)](https://packagist.org/packages/friendsofhyperf/cache)|
9+
|[command-benchmark](https://github.com/friendsofhyperf/command-benchmark)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/command-benchmark/v)](https://packagist.org/packages/friendsofhyperf/command-benchmark)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/command-benchmark/downloads)](https://packagist.org/packages/friendsofhyperf/command-benchmark)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/command-benchmark/d/monthly)](https://packagist.org/packages/friendsofhyperf/command-benchmark)|
910
|[command-signals](https://github.com/friendsofhyperf/command-signals)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/command-signals/v)](https://packagist.org/packages/friendsofhyperf/command-signals)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/command-signals/downloads)](https://packagist.org/packages/friendsofhyperf/command-signals)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/command-signals/d/monthly)](https://packagist.org/packages/friendsofhyperf/command-signals)|
1011
|[command-validation](https://github.com/friendsofhyperf/command-validation)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/command-validation/v)](https://packagist.org/packages/friendsofhyperf/command-validation)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/command-validation/downloads)](https://packagist.org/packages/friendsofhyperf/command-validation)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/command-validation/d/monthly)](https://packagist.org/packages/friendsofhyperf/command-validation)|
1112
|[compoships](https://github.com/friendsofhyperf/compoships)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/compoships/v)](https://packagist.org/packages/friendsofhyperf/compoships)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/compoships/downloads)](https://packagist.org/packages/friendsofhyperf/compoships)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/compoships/d/monthly)](https://packagist.org/packages/friendsofhyperf/compoships)|
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/.github export-ignore
2+
/.vscode export-ignore
3+
/tests export-ignore
4+
.gitattributes export-ignore
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: huangdijia
2+
custom: https://hdj.me/sponsors/
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: Close Pull Request
2+
3+
on:
4+
pull_request_target:
5+
types: [opened]
6+
7+
jobs:
8+
run:
9+
uses: friendsofhyperf/.github/.github/workflows/close-pull-request.yml@main
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
jobs:
9+
build:
10+
uses: friendsofhyperf/.github/.github/workflows/release.yaml@main

src/command-benchmark/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) D.J.Hwang
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

src/command-benchmark/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Command Signals
2+
3+
[![Latest Stable Version](https://img.shields.io/packagist/v/friendsofhyperf/command-benchmark)](https://packagist.org/packages/friendsofhyperf/command-benchmark)
4+
[![Total Downloads](https://img.shields.io/packagist/dt/friendsofhyperf/command-benchmark)](https://packagist.org/packages/friendsofhyperf/command-benchmark)
5+
[![License](https://img.shields.io/packagist/l/friendsofhyperf/command-benchmark)](https://github.com/friendsofhyperf/command-benchmark)
6+
7+
The benchmark component for Hyperf Command.
8+
9+
## Installation
10+
11+
```shell
12+
composer require friendsofhyperf/command-benchmark
13+
```
14+
15+
## Contact
16+
17+
- [Twitter](https://twitter.com/huangdijia)
18+
- [Gmail](mailto:huangdijia@gmail.com)
19+
20+
## License
21+
22+
[MIT](LICENSE)
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"name": "friendsofhyperf/command-benchmark",
3+
"description": "The benchmark component for Hyperf Command.",
4+
"license": "MIT",
5+
"type": "library",
6+
"keywords": [
7+
"hyperf",
8+
"v3.1"
9+
],
10+
"authors": [
11+
{
12+
"name": "huangdijia",
13+
"email": "huangdijia@gmail.com"
14+
}
15+
],
16+
"support": {
17+
"issues": "https://github.com/friendsofhyperf/components/issues",
18+
"source": "https://github.com/friendsofhyperf/components",
19+
"docs": "https://hyperf.fans",
20+
"pull-request": "https://github.com/friendsofhyperf/components/pulls"
21+
},
22+
"require": {
23+
"php": ">=8.1",
24+
"hyperf/collection": "~3.1.0",
25+
"hyperf/command": "~3.1.0",
26+
"hyperf/event": "^3.1.0"
27+
},
28+
"minimum-stability": "dev",
29+
"autoload": {
30+
"psr-4": {
31+
"FriendsOfHyperf\\CommandBenchmark\\": "src/"
32+
}
33+
},
34+
"config": {
35+
"sort-packages": true
36+
},
37+
"extra": {
38+
"branch-alias": {
39+
"dev-main": "3.1-dev"
40+
},
41+
"hyperf": {
42+
"config": "FriendsOfHyperf\\CommandBenchmark\\ConfigProvider"
43+
}
44+
}
45+
}

0 commit comments

Comments
 (0)