├── .github └── workflows │ └── tests.yml ├── .gitignore ├── LICENSE.txt ├── README.md ├── composer.json ├── phpunit.xml.dist ├── src ├── Profiler.php └── ProfilerDecorator.php └── tests └── ProfilerTest.php /.github/workflows/tests.yml: -------------------------------------------------------------------------------- 1 | name: Tests 2 | on: 3 | push: 4 | pull_request: 5 | workflow_dispatch: 6 | schedule: 7 | - cron: '0 4 * * 6' 8 | 9 | jobs: 10 | tests: 11 | name: Test ${{ matrix.swoole-version }} against php ${{ matrix.php-version }} 12 | runs-on: ${{ matrix.os }} 13 | strategy: 14 | fail-fast: false 15 | matrix: 16 | os: [ubuntu-latest] 17 | php-version: [ '8.2', '8.3' ] 18 | swoole-version: 19 | - swoole-5.1.6 20 | - swoole-6.0.0 21 | - openswoole-22.1.2 22 | - openswoole-25.2.0 23 | include: 24 | - os: ubuntu-latest 25 | php-version: '8.4' 26 | swoole-version: swoole-6.0.0 27 | - os: ubuntu-latest 28 | php-version: '8.4' 29 | swoole-version: openswoole-25.2.0 30 | steps: 31 | - name: Checkout source code 32 | uses: actions/checkout@v3 33 | - name: Setup PHP environment 34 | uses: shivammathur/setup-php@v2 35 | with: 36 | php-version: ${{ matrix.php-version }} 37 | tools: pecl, composer, phpunit, blackfire 38 | extensions: ${{ matrix.swoole-version }}, blackfire 39 | coverage: none 40 | env: 41 | fail-fast: true 42 | BLACKFIRE_SERVER_ID: ${{ secrets.BLACKFIRE_SERVER_ID }} 43 | BLACKFIRE_SERVER_TOKEN: ${{ secrets.BLACKFIRE_SERVER_TOKEN }} 44 | BLACKFIRE_CLIENT_ID: ${{ secrets.BLACKFIRE_CLIENT_ID }} 45 | BLACKFIRE_CLIENT_TOKEN: ${{ secrets.BLACKFIRE_CLIENT_TOKEN }} 46 | - name: Verify PHP environment 47 | run: | 48 | php --ri swoole || php --ri openswoole 49 | php --ri blackfire 50 | - name: Install dependencies 51 | run: composer install -n 52 | - name: Run test suite 53 | run: vendor/bin/phpunit 54 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | /vendor 3 | /composer.lock 4 | /composer.phar 5 | /.phpunit.result.cache -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | https://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | Copyright 2018-present Upscale Software 180 | 181 | Licensed under the Apache License, Version 2.0 (the "License"); 182 | you may not use this file except in compliance with the License. 183 | You may obtain a copy of the License at 184 | 185 | https://www.apache.org/licenses/LICENSE-2.0 186 | 187 | Unless required by applicable law or agreed to in writing, software 188 | distributed under the License is distributed on an "AS IS" BASIS, 189 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 190 | See the License for the specific language governing permissions and 191 | limitations under the License. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Blackfire Profiler for Swoole [![Build Status](https://github.com/upscalesoftware/swoole-blackfire/workflows/Tests/badge.svg?branch=master)](https://github.com/upscalesoftware/swoole-blackfire/actions?query=workflow%3ATests+branch%3Amaster) 2 | ============================= 3 | 4 | This library enables profiling of PHP applications running on [Swoole](https://github.com/swoole/swoole-src) / [Open Swoole](https://github.com/openswoole/swoole-src) web-server via [Blackfire](https://blackfire.io/). 5 | 6 | **Features:** 7 | - Transparent request profiling 8 | - Selective sub-system profiling 9 | - Custom start/stop profiling calls 10 | - [Blackfire Companion](https://blackfire.io/docs/integrations/) integration 11 | 12 | ## Installation 13 | 14 | The library is to be installed via [Composer](https://getcomposer.org/) as a dev dependency: 15 | ```bash 16 | composer require upscale/swoole-blackfire --dev 17 | ``` 18 | ## Usage 19 | 20 | ### Request Profiling 21 | 22 | The easiest way to start profiling is to activate the profiler for all requests from start to finish. 23 | This approach is by design completely transparent to an application running on the server. 24 | No changes are needed beyond adding a few lines of code to the server entry point. 25 | 26 | Install the profiling instrumentation for all requests: 27 | ```php 28 | $server->on('request', function ($request, $response) { 29 | $response->header('Content-Type', 'text/plain'); 30 | $response->end( 31 | 'CRC32: ' . hash_file('crc32b', __FILE__) . "\n" . 32 | 'MD5: ' . md5_file(__FILE__) . "\n" . 33 | 'SHA1: ' . sha1_file(__FILE__) . "\n" 34 | ); 35 | }); 36 | 37 | $profiler = new \Upscale\Swoole\Blackfire\Profiler(); 38 | $profiler->instrument($server); 39 | ``` 40 | 41 | ### Selective Profiling 42 | 43 | It is possible to limit the profiling scope by wrapping the interested code in a profiler call. 44 | 45 | Wrap the code intended to be profiled in the profiler call: 46 | ```php 47 | $profiler = new \Upscale\Swoole\Blackfire\Profiler(); 48 | 49 | $server->on('request', function ($request, $response) use ($profiler) { 50 | $response->header('Content-Type', 'text/plain'); 51 | 52 | $profiler->inspect($request, $response, function ($request, $response) { 53 | $response->write('CRC32: ' . hash_file('crc32b', __FILE__) . "\n"); 54 | }); 55 | 56 | $response->write('MD5: ' . md5_file(__FILE__) . "\n"); 57 | $response->write('SHA1: ' . sha1_file(__FILE__) . "\n"); 58 | }); 59 | ``` 60 | 61 | Currently, only one profiler inspection call is permitted per request. 62 | 63 | ### Manual Profiling 64 | 65 | Depending on the application design and complexity, it may be difficult to precisely wrap desired code in the profiler call. 66 | Profiler start/stop calls can be manually placed at different call stack levels to further narrow down the inspection scope. 67 | Developer is responsible for the symmetry of the start/stop calls taking into account the response population workflow. 68 | The profiling must be stopped before sending the response body to be able to send the results in the response headers. 69 | 70 | Surround the code intended to be profiled with the profiler start/stop calls: 71 | ```php 72 | $profiler = new \Upscale\Swoole\Blackfire\Profiler(); 73 | 74 | $server->on('request', function ($request, $response) use ($profiler) { 75 | $response->header('Content-Type', 'text/plain'); 76 | 77 | $output = 'CRC32: ' . hash_file('crc32b', __FILE__) . "\n"; 78 | 79 | $profiler->start($request); 80 | $output .= 'MD5: ' . md5_file(__FILE__) . "\n"; 81 | $profiler->stop($request, $response); 82 | 83 | $output .= 'SHA1: ' . sha1_file(__FILE__) . "\n"; 84 | 85 | $response->end($output); 86 | }); 87 | ``` 88 | 89 | Currently, only one pair of the profiler start/stop calls is permitted per request. 90 | 91 | ## Limitations 92 | 93 | The profiling implicitly stops before sending the response body and the results are added to the response headers. 94 | Currently, only one profiling session initiated by `inspect()` or `start/stop()` calls is supported per request. 95 | 96 | ## Contributing 97 | 98 | Pull Requests with fixes and improvements are welcome! 99 | 100 | ## License 101 | 102 | Copyright © Upscale Software. All rights reserved. 103 | 104 | Licensed under the [Apache License, Version 2.0](https://github.com/upscalesoftware/swoole-blackfire/blob/master/LICENSE.txt). -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "upscale/swoole-blackfire", 3 | "description": "Blackfire profiler integration for Swoole web-server", 4 | "version": "4.3.0", 5 | "keywords": ["Swoole", "Blackfire", "Blackfire.io", "profiler", "profiling", "integration", "companion"], 6 | "homepage": "https://github.com/upscalesoftware/swoole-blackfire", 7 | "license": "Apache-2.0", 8 | "authors": [ 9 | { 10 | "name": "Upscale Software Team", 11 | "email": "info@upscalesoftware.com" 12 | } 13 | ], 14 | "require": { 15 | "php": ">=8.0", 16 | "blackfire/php-sdk": "^1.16||^2.0", 17 | "upscale/ext-swoole": "^4.0||^5.0||^6.0", 18 | "upscale/ext-openswoole": "^4.0||^22.0||^25.2", 19 | "upscale/swoole-reflection": "^2.0||^3.0" 20 | }, 21 | "require-dev": { 22 | "phpunit/phpunit": "^9.5", 23 | "upscale/swoole-launchpad": "^2.0" 24 | }, 25 | "autoload": { 26 | "psr-4": {"Upscale\\Swoole\\Blackfire\\": "src/"} 27 | }, 28 | "autoload-dev": { 29 | "psr-4": { 30 | "Upscale\\Swoole\\Blackfire\\Tests\\": "tests/", 31 | "Upscale\\Swoole\\Launchpad\\Tests\\": "vendor/upscale/swoole-launchpad/tests/" 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | tests 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/Profiler.php: -------------------------------------------------------------------------------- 1 | setMiddleware($this->wrap($server->getMiddleware())); 22 | } 23 | 24 | /** 25 | * Invoke a given middleware decorated for profiling 26 | */ 27 | public function inspect(\Swoole\Http\Request $request, \Swoole\Http\Response $response, callable $middleware): void 28 | { 29 | $middleware = $this->wrap($middleware); 30 | $middleware($request, $response); 31 | } 32 | 33 | /** 34 | * Decorate a given middleware for profiling 35 | */ 36 | private function wrap(callable $middleware): callable 37 | { 38 | return new ProfilerDecorator($middleware, $this); 39 | } 40 | 41 | /** 42 | * Start profiling a given request 43 | */ 44 | public function start(\Swoole\Http\Request $request): bool 45 | { 46 | if (!$this->probe && isset($request->header['x-blackfire-query'])) { 47 | $this->probe = new \BlackfireProbe($request->header['x-blackfire-query']); 48 | $this->request = $request; 49 | if (!$this->probe->enable()) { 50 | $this->reset(); 51 | throw new \UnexpectedValueException('Cannot enable Blackfire profiler'); 52 | } 53 | return true; 54 | } 55 | return false; 56 | } 57 | 58 | /** 59 | * Stop profiling a given request and send results in a response 60 | */ 61 | public function stop(\Swoole\Http\Request $request, \Swoole\Http\Response $response): bool 62 | { 63 | if ($this->probe && $this->probe->isEnabled() && $this->request === $request) { 64 | $this->probe->close(); 65 | list($probeHeaderName, $probeHeaderValue) = explode(':', $this->probe->getResponseLine(), 2); 66 | $this->reset(); 67 | $response->header(strtolower("x-$probeHeaderName"), trim($probeHeaderValue)); 68 | return true; 69 | } 70 | return false; 71 | } 72 | 73 | /** 74 | * Reset profiling session 75 | */ 76 | private function reset(): void 77 | { 78 | if ($this->probe && $this->probe->isEnabled()) { 79 | $this->probe->close(); 80 | } 81 | $this->probe = null; 82 | $this->request = null; 83 | } 84 | } -------------------------------------------------------------------------------- /src/ProfilerDecorator.php: -------------------------------------------------------------------------------- 1 | subject = $subject; 24 | $this->profiler = $profiler; 25 | } 26 | 27 | /** 28 | * Invoke the underlying middleware surrounding it with the profiler start/stop calls 29 | */ 30 | public function __invoke(\Swoole\Http\Request $request, \Swoole\Http\Response $response): void 31 | { 32 | $middleware = $this->subject; 33 | if ($this->profiler->start($request)) { 34 | try { 35 | $observedResponse = new Response\Observable($response); 36 | $observedResponse->onHeadersSentBefore(function () use ($request, $response) { 37 | $this->profiler->stop($request, $response); 38 | }); 39 | $middleware($request, $observedResponse); 40 | } finally { 41 | $this->profiler->stop($request, $response); 42 | } 43 | } else { 44 | $middleware($request, $response); 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /tests/ProfilerTest.php: -------------------------------------------------------------------------------- 1 | server = new \Swoole\Http\Server('127.0.0.1', 8080); 23 | $this->server->set([ 24 | 'log_file' => '/dev/null', 25 | 'log_level' => 4, 26 | 'worker_num' => 3, 27 | 'dispatch_mode' => 1, 28 | ]); 29 | 30 | $this->subject = new Profiler(); 31 | } 32 | 33 | public function testInactive() 34 | { 35 | $this->server->on('request', function ($request, $response) { 36 | $response->header('Content-Type', 'text/plain'); 37 | $response->end( 38 | 'CRC32: ' . hash_file('crc32b', __FILE__) . "\n" . 39 | 'MD5: ' . md5_file(__FILE__) . "\n" . 40 | 'SHA1: ' . sha1_file(__FILE__) . "\n" 41 | ); 42 | }); 43 | 44 | $this->spawn($this->server); 45 | 46 | $result = `blackfire curl http://127.0.0.1:8080/ 2>&1`; 47 | $this->assertStringContainsString('No probe response, Blackfire not properly installed', $result); 48 | $this->assertStringNotContainsString('Blackfire cURL completed', $result); 49 | } 50 | 51 | public function testInstrument() 52 | { 53 | $this->server->on('request', function ($request, $response) { 54 | $response->header('Content-Type', 'text/plain'); 55 | $response->end( 56 | 'CRC32: ' . hash_file('crc32b', __FILE__) . "\n" . 57 | 'MD5: ' . md5_file(__FILE__) . "\n" . 58 | 'SHA1: ' . sha1_file(__FILE__) . "\n" 59 | ); 60 | }); 61 | 62 | $this->subject->instrument($this->server); 63 | 64 | $this->spawn($this->server); 65 | 66 | $result = `blackfire curl http://127.0.0.1:8080/ 2>&1`; 67 | $this->assertStringContainsString('Blackfire cURL completed', $result); 68 | } 69 | 70 | public function testInspect() 71 | { 72 | $this->server->on('request', function ($request, $response) { 73 | $response->header('Content-Type', 'text/plain'); 74 | 75 | $this->subject->inspect($request, $response, function ($request, $response) { 76 | $response->write('CRC32: ' . hash_file('crc32b', __FILE__) . "\n"); 77 | }); 78 | 79 | $response->write('MD5: ' . md5_file(__FILE__) . "\n"); 80 | $response->write('SHA1: ' . sha1_file(__FILE__) . "\n"); 81 | }); 82 | 83 | $this->spawn($this->server); 84 | 85 | $result = `blackfire curl http://127.0.0.1:8080/ 2>&1`; 86 | $this->assertStringContainsString('Blackfire cURL completed', $result); 87 | } 88 | 89 | public function testStartStop() 90 | { 91 | $this->server->on('request', function ($request, $response) { 92 | $response->header('Content-Type', 'text/plain'); 93 | 94 | $output = 'CRC32: ' . hash_file('crc32b', __FILE__) . "\n"; 95 | 96 | $this->subject->start($request); 97 | $output .= 'MD5: ' . md5_file(__FILE__) . "\n"; 98 | $this->subject->stop($request, $response); 99 | 100 | $output .= 'SHA1: ' . sha1_file(__FILE__) . "\n"; 101 | 102 | $response->end($output); 103 | }); 104 | 105 | $this->spawn($this->server); 106 | 107 | $result = `blackfire curl http://127.0.0.1:8080/ 2>&1`; 108 | $this->assertStringContainsString('Blackfire cURL completed', $result); 109 | } 110 | } --------------------------------------------------------------------------------