Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fs/http sniffers #186

Merged
merged 24 commits into from
Feb 13, 2023
Merged

Fs/http sniffers #186

merged 24 commits into from
Feb 13, 2023

Conversation

xepozz
Copy link
Member

@xepozz xepozz commented Feb 4, 2023

Q A
Is bugfix?
New feature? ✔️
Breaks BC?

I've added the following snippet to the blog-api demo InfoController:

file_get_contents(__FILE__);
file_put_contents(dirname(__DIR__).'/runtime/1.txt', 'smth');
$fp = fopen("example_homepage.txt", "w");
fwrite($fp, 'smth');
fclose($fp);

And got the following:

The index additional info:

"file": {
    "read": 2,
    "write": 2,
    "mkdir": 1
},

The common result addition info:

"Yiisoft\\Yii\\Debug\\Collector\\FileStreamCollector": {
    "read": [
        {
            "path": "\/Users\/xepozz\/PhpstormProjects\/yiisoft\/yii-dev-tool\/dev\/demo\/blog-api\/src\/InfoController.php",
            "args": []
        },
        {
            "path": "\/Users\/xepozz\/PhpstormProjects\/yiisoft\/yii-dev-tool\/dev\/demo\/blog-api\/src\/InfoController.php",
            "args": []
        }
    ],
    "write": [
        {
            "path": "\/Users\/xepozz\/PhpstormProjects\/yiisoft\/yii-dev-tool\/dev\/demo\/blog-api\/runtime\/1.txt",
            "args": []
        },
        {
            "path": "\/Users\/xepozz\/PhpstormProjects\/yiisoft\/yii-dev-tool\/dev\/demo\/blog-api\/example_homepage.txt",
            "args": []
        }
    ],
    "mkdir": [
        {
            "path": "\/Users\/xepozz\/PhpstormProjects\/yiisoft\/yii-dev-tool\/dev\/demo\/blog-api\/runtime\/debug\/2023-02-04\/63dea2b0c83132.65824852",
            "args": {
                "mode": 509,
                "options": 9
            }
        }
    ]
},

Rewrote tests because FS accessing affect tests.

Performance can be enhanced

@xepozz xepozz changed the title Fs sniffer Fs/http sniffers Feb 5, 2023
@codecov
Copy link

codecov bot commented Feb 5, 2023

Codecov Report

Base: 84.50% // Head: 67.06% // Decreases project coverage by -17.45% ⚠️

Coverage data is based on head (881c8ea) compared to base (dc6b167).
Patch coverage: 22.76% of modified lines in pull request are covered.

Additional details and impacted files
@@              Coverage Diff              @@
##             master     #186       +/-   ##
=============================================
- Coverage     84.50%   67.06%   -17.45%     
- Complexity      375      513      +138     
=============================================
  Files            39       44        +5     
  Lines          1162     1597      +435     
=============================================
+ Hits            982     1071       +89     
- Misses          180      526      +346     
Impacted Files Coverage Δ
src/Collector/HttpClientCollector.php 0.00% <0.00%> (ø)
src/Collector/HttpClientInterfaceProxy.php 0.00% <0.00%> (ø)
src/Helper/StreamWrapper/StreamWrapper.php 0.00% <0.00%> (ø)
src/Collector/FilesystemStreamProxy.php 7.63% <7.63%> (ø)
src/Collector/HttpStreamProxy.php 10.07% <10.07%> (ø)
src/Collector/HttpStreamCollector.php 97.14% <97.14%> (ø)
src/Collector/FilesystemStreamCollector.php 100.00% <100.00%> (ø)
src/Collector/RequestCollector.php 90.14% <100.00%> (+1.25%) ⬆️
src/Collector/ValidatorInterfaceProxy.php 0.00% <0.00%> (-91.67%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@xepozz xepozz marked this pull request as ready for review February 9, 2023 21:55
@xepozz xepozz requested a review from a team February 9, 2023 21:59
@xepozz xepozz added the status:code review The pull request needs review. label Feb 9, 2023
config/common.php Outdated Show resolved Hide resolved
src/Collector/HttpStreamCollector.php Show resolved Hide resolved
@xepozz xepozz merged commit f9a215b into master Feb 13, 2023
@xepozz xepozz deleted the fs-sniffer branch February 13, 2023 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:code review The pull request needs review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants