Pete's Log: Another Esgerdev Update

Entry #2475, (Meta)
(posted when I was 45 years old.)

"Progress" continues on the esgeroth.org rewrite. Some highlights:

  • PHP 8.2 has become available to me, so I've done some refactoring to take advantage of new features
  • Having implemented support for PSR-15 middlewares, I wrote a CSRF mitigation middleware. Any request that isn't a GET/HEAD/OPTIONS requires that the origin of the request be www.esgeroth.org and that a token be passed in the request body that matches a token stored server-side for the session.
  • I fleshed out my implementation of PSR-7 UriInterface and implemented a somewhat comprehensive test suite for it. This exercise got me no closer to completing the rewrite, but it was mentally soothing to read through RFC 3986 and code to the spec. And I even learned a few new things about URIs (all edge cases though).
  • I added PHP-CS-Fixer as an additional tool to run my code through, primarily because it can detect unused "use" statements, which none of the other checkers I'm using currently do.

Stats:

Test coverage has dropped since last reported, but only because the denominators have been growing faster than the numerators. The amount of covered code has increased. I'm also less worried about maximizing test coverage than I was when I started this project, because with strictness set to 8, phpstan now catches the sort of errors that lead to the issue that kicked off this rewrite to begin with. So as long as phpstan reports no errors, I can live with less than 100% test coverage. I still want more than I have now, though!

OK, but incomplete, skipped, or risky tests! Tests: 427, Assertions: 1086, Skipped: 1. Code Coverage Report: 2024-01-21 03:27:18 Summary: Classes: 31.25% (25/80) Methods: 41.76% (185/443) Lines: 33.21% (653/1966)

I neglected to record what arguments I previously used for siege. I am now going to try to track two result sets, with and without the --no-parser flag. With that flag, siege is only requesting php pages and measuring how long they take. Without the flag, the pages also get parsed and all other items like images, css and so on gets loaded. So here's where we're currently at.

$ siege -r 100 -f esgerdev.txt -c 25 -i --no-parser Transactions: 2500 hits Availability: 100.00 % Elapsed time: 3.20 secs Data transferred: 4.50 MB Response time: 0.03 secs Transaction rate: 781.25 trans/sec Throughput: 1.41 MB/sec Concurrency: 24.75 Successful transactions: 1702 Failed transactions: 0 Longest transaction: 0.05 Shortest transaction: 0.02 $ siege -r 100 -f esgerdev.txt -c 25 -i Transactions: 18041 hits Availability: 100.00 % Elapsed time: 14.93 secs Data transferred: 16.46 MB Response time: 0.02 secs Transaction rate: 1208.37 trans/sec Throughput: 1.10 MB/sec Concurrency: 23.72 Successful transactions: 17251 Failed transactions: 0 Longest transaction: 0.07 Shortest transaction: 0.00