Code Monkey home page Code Monkey logo

slog's Introduction

slog

banner

Description

Analyse oik-bwtrace daily trace summary reports.

Making use of oik-bwtrace's daily trace summary reports, Slog provides some mechanisms to see what your site's been doing.

Use this to determine the effect of activating / deactivating a plugin on server side performance.

The Slog plugin is a generic solution to enable performance comparison of server responses with different server configurations.

Slog admin tabs are:

Function Processing
Reports Produce a variety of reports for a single daily trace summary file.
Compare Produce comparison charts for two or more trace summary files.
Filter Filter a daily trace summary file.
Download Download a daily trace summary file from a remote host site.
Driver Run a series of requests against the server URL.
Search Search trace files for a selected string.
Settings Define default/initial settings for the reports.

Reports

Reports - View the daily trace output grouped and summarised in a variety of ways.

  • Use the sb-chart-block plugin to visualise the data in a chart.
  • The summary data is also shown in a table.

Compare

Compares the output of two or more daily trace summary downloads / filtered files.

Requires sb-chart-block.

Use this to visualise the effect of activating / deactivating a plugin on server side performance.

Filter

The purpose of Filtering is to reduce a daily trace summary file to a subset of requests that allow better comparison of multiple files.

Examples:

  • Reasonable responses < x.y secs
  • Only GET requests performed on the front-end ( FE ) by real users, not bots ( BOT ).
  • Only requests which resulted in a 200( OK ) HTTP response code.

Download

Use the Download tab to download a daily trace summary file.

This will only work if the file is accessible to any browser. If the file is protected from general access, returning a 403 or otherwise, then you'll need to download the file by another mechanism. eg FTP or from your site's control panel.

Driver

Drives a series of requests to the server. Use this when you want to measure/compare server response time over a number of requests.

Search

Allows you to search multiple trace files for any string. Produces a link to each file searched. Search may produce a lot of output.

Settings

Use the Settings tab to define default values to be used in the other forms.

Usage

  • The Slog admin page is only accessible to authorised users.
  • This page is only available when oik-bwtrace is activated.
  • To see the results graphically you need the sb-chart-block plugin.

Installation

  1. Upload the contents of the slog plugin to the `/wp-content/plugins/slog' directory
  2. Activate the plugin
  3. Visit Settings > Slog admin Settings tab to define your defaults

Frequently Asked Questions

What else do I need?

  • oik-bwtrace to produce the daily trace summary files in the first place.
  • sb-chart-block to display the charts.

How do I measure the effect of changes?

Use the Compare tab to visualise the effect of changes by comparing two or more trace summary files created with different configurations.

Does it work on WordPress Multi Site?

  • WordPress MultiSite sites add the blog_id suffix to each site other than site 1.
  • The results you get on a particular site depend on the daily trace summary prefix.
  • This defaults to bwtrace.vt

Does it profile an individual request?

No. If you want to profile individual requests then you will need more granular information.

How has it been used?

  • Slog was originally developed to help compare the performance of 3 different hosting solutions.
  • It was extended at the end of 2015 during the "12 days of Christmas" to analyse the effect of the top 12 WordPress plugins on server execution time.
  • A lot of data was produced, but the charts were never published.
  • In subsequent years I compared the performance of different versions of WordPress 4.4 through 4.7
  • The recent improvements have been developed to help measure the effect of selected plugins on server side performance.

slog, which is a contraction of "trace log", is the generalised version of the code that might enable others to perform their own analysis.

For other bespoke routines to analyse daily trace summary files see the slog-bloat plugin.

Screenshots

  1. Slog admin > Reports tab - Form
  2. Slog admin > Reports tab - Chart
  3. Slog admin > Reports tab - Table
  4. Slog admin > Compare tab
  5. Slog admin > Download tab
  6. Slog admin > Filter tab
  7. Slog admin > Settings tab
  8. Slog admin > Driver tab
  9. Slog admin > Search tab

Upgrade Notice

1.5.1

Update for support for PHP 8.1 and PHP 8.2

1.5.0

Upgrade for easier running of server performance tests

1.4.0

Upgrade for the prototype Search facility.

1.3.1

Add 100th second interval. Set elapsed limit to 1 second. Added copy CSV to clipboard button.

1.3.0

Adds the Driver tab.

1.2.1

Elapsed report supports greater interval granularity.

1.2.0

Now includes logic merged from slog-bloat.

1.1.3

Improved the Report title.

1.1.2

Update for improved resilience.

1.1.1

Update for automatic filtering, if required.

1.1.0

Upgrade for Horizontal bar charts and other improvements related to slog-bloat.

0.0.1

Now supports source trace summary files with date format yyyymmdd or mmdd

0.0.0

New plugin, available from oik-plugins and GitHub

Changelog

1.5.1

  • Changed: Support PHP 8.1 and PHP 8.2 #31
  • Tested: With WordPress 6.4.1 and WordPress Multisite
  • Tested: With PHP 8.0, PHP 8.1 and PHP 8.2
  • Tested: With PHPUnit 9.6

1.5.0

  • Changed: Add URL filtering logic
  • Changed: Remove out of date comment
  • Changed: Driver tab: Add Daily Trace Summary box to set the trace summary file #25

1.4.0

  • Added: Search tab,#23
  • Tested: With WordPress 5.7 and WordPress Multi Site
  • Tested: With PHP 8.0

1.3.1

  • Added: Ability to set the Interval and Elapsed limit,#18
  • Added: Copy CSV to clipboard button,#20
  • Changed: Compare up to 15 files.
  • Changed: Format table numbers with 6 decimal places.

1.3.0

  • Added: First pass adding a Driver tab to run a request multiple times.,#19
  • Tested: With WordPress 5.6.1 and WordPress Multi Site
  • Tested: With PHP 7.4

1.2.1

  • Changed: Support various intervals for Elapsed report,#18

1.2.0

  • Changed: Merged the admin page from slog-bloat,#16

1.1.3

  • Changed: Updated the Report title display.

1.1.2

1.1.1

  • Changed: Apply slog bloat automatic filters if required,bobbingwide/slog-bloat#3
  • Fixed: Avoid Warning when running Elapsed report against badly formed records,#15

1.1.0

1.0.0

  • Added: Lots of changes - see Git commit history ?

0.0.1

  • Changed: Support bwtrace.vt.yyyymmdd.site_id files
  • Changed: Copied code from the unpublished play folder #1
  • Changed: Use file_get_contents() in order to handle large files #2
  • Added: vt-ip.php to find IPs to block #3

0.0.0

  • Added: New plugin

slog's People

Contributors

bobbingwide avatar

Watchers

 avatar  avatar

slog's Issues

Slog Request type report shows more GET-404's than in the daily trace file

The Slog request type report run against https://oik-plugins.uk/bwtrace/bwtrace.vt.20210313 reported 71 GET-404's
but viewing the file I can only see one. What are the other 70?

Additionally, GET-404 isn't a request type I can filter on.

As an aside. I also see requests from IP address 127.0.0.1 taking varying amounts of time.

/,,3.981695,7.3.27,2109,5304,1550,34,1813,55,36,16,66,,,,,78300,127.0.0.1,3.416422,2021-03-13T20:10:53+00:00,,GET,
/,,1.051810,7.3.27,2109,5313,1550,34,1813,55,36,16,64,,,,,79306,127.0.0.1,1.050910,2021-03-13T20:10:55+00:00,,GET,
/,,14.107096,7.3.27,2109,5304,1555,34,1818,55,36,16,75,,,,,80425,127.0.0.1,14.034743,2021-03-13T20:11:09+00:00,,GET,

These don't report an HTTP response. Why not?

Warning: A non-numeric value encountered in slog\libs\class-vt-stats.php on line 461

When a record in the daily trace summary file is badly formed
eg a record that only contains 200
then a Warning message is issued for the Elapsed report type.

Warning: A non-numeric value encountered in C:\apache\htdocs\wordpress\wp-content\plugins\slog\libs\class-vt-stats.php on line 461

This is due to the field's value ($this->field_value) being set to " " in Object_Grouper::group.
Setting the value to null resolves this issue.

Add support to filter a specific URL

The current filtering options which are run on some tabs can filter requests by request type ( eg only return GET-FE - Front end GET requests ). This will still list any URL requested. When running comparisons of daily trace summary files it would be nice to compare daily trace summary files for a single URL, or range of URLs without having to use the Driver functionality.

Requirement

  • Add a Filter URL input field to be used to filter requests when the URL matches.

Proposed solution

  • Add the Filter URL field on the Settings tab ( _slog_filter_url )
  • Implement the filter URL logic
  • Implement as overrides for each of the relevant tabs:
  • Reports - YES
  • Compare - YES
  • Filter _ Maybe
  • Driver - No
  • Search - Not necessary
  • Settings - already done

Uncaught Error: Call to a member function fetch_table() on null

With slog v1.0.0 and slog-bloat v0.0.0 both activated I got the following on the first display of the Slog admin page.

I believe it was because I hadn't selected a daily trace summary file.

Fatal error: Uncaught Error: Call to a member function fetch_table() on null in /home/customer/www/herbmiller.me/public_html/wp-content/plugins/slog/libs/class-slog-reporter.php:77 Stack trace: #0 /home/customer/www/herbmiller.me/public_html/wp-content/plugins/slog/slog.php(344): Slog_Reporter->fetch_table() #1 /home/customer/www/herbmiller.me/public_html/wp-content/plugins/oik/libs/class-BW-.php(97): slog_admin_table() #2 /home/customer/www/herbmiller.me/public_html/wp-content/plugins/slog/slog.php(107): BW_::oik_box(NULL, 'slog_admin_tabl...', 'CSV table', 'slog_admin_tabl...') #3 /home/customer/www/herbmiller.me/public_html/wp-includes/class-wp-hook.php(287): slog_admin_page('') #4 /home/customer/www/herbmiller.me/public_html/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters('', Array) #5 /home/customer/www/herbmiller.me/public_html/wp-includes/plugin.php(484): WP_Hook->do_action(Array) #6 /home/customer/www/herbmiller.me/public_html/wp-admin/admin.php(259): do_action('settings_page_s...') #7 /home/customer/ww in /home/customer/www/herbmiller.me/public_html/wp-content/plugins/slog/libs/class-slog-reporter.php on line 77

vt.php - Produce a simple summary of server performance

Back in May 2020 I updated vt.php to calculate very high level averages for the bwtrace.vt.ccyymmdd files for a number of websites, saving the output in a number of .csv files.

What I didn't do was to calculate the average response for each site, nor tabulate it by hosting.

So I'll do that now.

Site Count Average Hosting
anchorgolf.com.csv 761922 0.226095 TSOHost
bobbingwidewebdesign.com.csv 162044 0.307158 SiteGround
classic-car-doctor.csv 153024 0.236883 TSOHost
oik-plugins.co.uk.csv 1076074 0.416334 TSOHost
oik-plugins.com-all.csv 1559070 0.433432 SiteGround
seriouslybonkers.com-all.csv 194869 0.403579 SiteGround
stainedglass-portsmouth.com.csv 922050 0.265312 TSOHost
wp-pompey.org.uk-all.csv 206534 0.637442 TSOHost

Counting home page requests only.

Site Count Average Hosting
oik-plugins.com.csv 16859 0.321109 SiteGround
seriouslybonkers.com.csv 5026 0.35352 SiteGround
stainedglass-portsmouth.com.csv 922050 0.265312 TSOHost
wp-pompey.org.uk.csv 7663 0.564937 TSOHost

Provide option to set daily trace summary file name on Slog admin > Driver tab

When running Slog driver to produce comparison files it's currently necessary to

  1. Use oik trace options to blank out the trace summary file
  2. Get set up prior to running the driver
  3. Use oik trace options to set the trace summary file for the test run
  4. Run the driver
  5. Use oik trace options to blank out the trace summary file
  6. Run Slog admin > Compare
  7. Repeat for another test.

Stripped request URIs top level should cater for subdirectory installs

In a (local) subdirectory install, when producing a report grouped by Stripped request URIs top level it makes more sense to look at the second part of any request that's prefixed by the subdirectory installs folder name.
This should be easy when slog is being run against the local file.

example summary file

/oikcom/?ao_speedup_cachebuster=13906,,6.584218,7.4.0,1293,6355,979,57,1349,74,41,23,168,0.33548879623413,C:/apache/htdocs/oikcom/bwtrace/bwtraces.loh.1,916,0,30985,127.0.0.1,6.547538,2021-01-31T09:04:22+00:00,WordPress/5.6; https://s.b/oikcom,GET,200
/oikcom/wp-admin/admin-ajax.php?action=autoptimize_delete_cache&nonce=baf8fa1366&_=1612083833326,autoptimize_delete_cache,23.861941,7.4.0,1293,6624,962,57,1351,74,41,23,77,,,,,18868,127.0.0.1,23.787242,2021-01-31T09:04:22+00:00,Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML; like Gecko) Chrome/88.0.4324.104 Safari/537.36,GET,200
/oikcom/,,16.533602,7.4.0,1293,6355,975,57,1349,74,41,23,170,0.26832222938538,C:/apache/htdocs/oikcom/bwtrace/bwtraces.loh.9,916,0,30672,127.0.0.1,16.497638,2021-01-31T09:04:26+00:00,Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML; like Gecko) Chrome/88.0.4324.104 Safari/537.36,GET,200
/oikcom/wordpress-plugins-from-oik-plugins/,,3.736265,7.4.0,1293,6167,962,57,1324,74,41,23,169,0.21986675262451,C:/apache/htdocs/oikcom/bwtrace/bwtraces.loh.4,746,1,29184,127.0.0.1,3.705882,2021-01-31T09:04:33+00:00,Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML; like Gecko) Chrome/88.0.4324.104 Safari/537.36,GET,200
/oikcom/wp-cron.php?doing_wp_cron=1612083943.3039140701293945312500,,1.817750,7.4.0,1293,5809,875,57,1191,74,41,23,58,0.073328971862793,C:/apache/htdocs/oikcom/bwtrace/bwtraces.loh.8,129,0,16352,127.0.0.1,1.808337,2021-01-31T09:05:45+00:00,WordPress/5.6; https://s.b/oikcom,POST,200

It's not so easy if the daily trace summary file has been downloaded from another system.

Detect content served from a cache

<!-- Cached by WP-Optimize (gzip) - https://getwpo.com - Last modified: Thu, 02 Dec 2021 08:36:42 GMT -->

ย 
There are some cacheing plugins that deliver cached content to the requester.
In theory, delivering cached content should speed up the website
Slog's Driver tab isn't noticing when the served response has been cached.
There are a couple of problems to be considered.

  1. Slog admin > Driver does not appear to get served the cached results
  2. If it was server the cache results the Daily Trace Summary would not record the transaction
  3. So server performance statisfics would only show the average time of requests actually satisfied
  4. It could not be used to summarise requests.
  5. It may be necessary to get information from the access log

Fatal from sg-cachepress running slog admin > driver

When changing settings on slog admin > driver I get warning messages from sg-cachepress.
These occur with the latest version of SiteGround Optimizer, the sg-cachepress plugin .

Warning: Use of undefined constant COOKIEHASH - assumed 'COOKIEHASH' (this will throw an Error in a future version of PHP) in /home/customer/www/bobbingwide.com/public_html/wp-content/plugins/sg-cachepress/core/File_Cacher/File_Cacher.php on line 785

Warning: Cannot modify header information - headers already sent by (output started at /home/customer/www/bobbingwide.com/public_html/wp-content/plugins/sg-cachepress/core/File_Cacher/File_Cacher.php:785) in /home/customer/www/bobbingwide.com/public_html/wp-admin/includes/misc.php on line 1416

Display chart's raw data in tabular form

In addition to displaying a chart showing Count / Total elapsed / Average/ Percentage / etc for the selected groups I'd like to see the calculated data that could have been used to create the chart in the form of a table.
This can be used to decide which is the most useful chart to display the data.

Requirements

  • Shows the columns as in the example.
  • Column 1 heading to be the report type
  • Rows to show the filtered results after applying the Having value ( same as for the chart )

Example

For the Request Types report, with Having set to 2, using /tests/data/request-types-test.vt.20210106

Request types Count Total elapsed Average Percentage count Percentage elapsed Accumulated count Accumulated percentage
GET-FE 4 5.166991 1.29174775 44.444444444444 13.312028039864 44.444444444444 13.312028039864
POST-AJAX 3 19.068049 6.3560163333333 33.333333333333 49.126155426533 77.777777777778 62.438183466396
POST-ADMIN 2 14.579414 7.289707 22.222222222222 37.561816533604 100 100

Proposed solution

  • Display using table tags
  • Partially responsive - with a minimum width defined by WordPress
  • No need to round figures
  • May need to cater for divide by zero

Potential enhancements

  • Ability to choose the column(s) as the data for the chart.
  • Ability to compare results with other sets of data.

Stripped request URIs report option produces a load of undefined labels.

While analysing the daily trace summary files from oik-plugins.co.uk I noticed a problem with the
Stripped request URIs report. It was producing a load of undefined labels.
Test URL: https://s.b/oikcom/wp-admin/options-general.php?page=slog
Source file: C:/apache/htdocs/wordpress/wp-content/plugins/slog-bloat/working/2021/oikcouk0126.csv

Here the results are displayed using a Horizontal bar chart
image

Unexpected results

  1. All the undefined labels
  2. The table of results has too many columns
  3. The label is far too long... wen viewed as a Bar chart you may only see one bar.

Expected result

  1. Only one label
  2. Correct number of columns in the table
  3. Label length less than so many characters. Where so many is TBD.

Explanation

The problems are because the URI contains commas. The request being.

"/usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/wp-cli/php/boot-fs.php --path=/home/oikcouk/public_html --no-color config-settings get --params=DB_CHARSET,DB_NAME,DB_USER,DB_PASSWORD,DB_HOST,DOMAIN_CURRENT_SITE,PATH_CURRENT_SITE,MULTISITE,SUBDOMAIN_INSTALL,WP_AUTO_UPDATE_CORE,WPCACHEHOME,WP_DEBUG,WP_DEBUG_LOG,WP_DEBUG_DISPLAY,SCRIPT_DEBUG,SAVEQUERIES,WP_AUTO_UPDATE_CORE,WP_HOME,WP_SITEURL,CONCATENATE_SCRIPTS,DISALLOW_FILE_EDIT,WP_CACHE_KEY_SALT,DISABLE_WP_CRON --format=json",,0.207512,7.4.14,1749,3182,468,1,441,51,10,5,2,0.011967897415161,,,,5060,127.0.0.1,0.207451,2021-01-29T11:48:25+00:00,,GET

Fatal error trying to filter for contact when producing an IP address report

Warning: Undefined array key "_slog_request_filters" in C:\apache\htdocs\wordpress\wp-content\plugins\slog\libs\class-slog-reports-form.php on line 189

Fatal error: Uncaught TypeError: implode(): Argument #1 ($pieces) must be of type array, string given in C:\apache\htdocs\wordpress\wp-content\plugins\slog\libs\class-slog-reports-form.php:189 Stack trace: #0 C:\apache\htdocs\wordpress\wp-content\plugins\slog\libs\class-slog-reports-form.php(189): implode(',', NULL) #1 C:\apache\htdocs\wordpress\wp-content\plugins\slog\libs\class-slog-reports-form.php(114): Slog_Reports_Form->chart_content() #2 C:\apache\htdocs\wordpress\wp-content\plugins\oik-bwtrace\libs\class-BW-.php(97): Slog_Reports_Form->display_chart() #3 C:\apache\htdocs\wordpress\wp-content\plugins\slog\libs\class-slog-admin.php(174): BW_::oik_box(NULL, 'display_chart', 'Chart', Array) #4 C:\apache\htdocs\wordpress\wp-includes\class-wp-hook.php(324): Slog_Admin->nav_tab_reports('') #5 C:\apache\htdocs\wordpress\wp-includes\class-wp-hook.php(348): WP_Hook->apply_filters('', Array) #6 C:\apache\htdocs\wordpress\wp-includes\plugin.php(517): WP_Hook->do_action(Array) #7 C:\apache\htdocs\wordpress\wp-content\plugins\slog\libs\class-slog-admin.php(133): do_action('slog_nav_tab_re...') #8 C:\apache\htdocs\wordpress\wp-content\plugins\slog\slog.php(168): Slog_Admin->process() #9 C:\apache\htdocs\wordpress\wp-includes\class-wp-hook.php(324): slog_admin_page('') #10 C:\apache\htdocs\wordpress\wp-includes\class-wp-hook.php(348): WP_Hook->apply_filters('', Array) #11 C:\apache\htdocs\wordpress\wp-includes\plugin.php(517): WP_Hook->do_action(Array) #12 C:\apache\htdocs\wordpress\wp-admin\admin.php(259): do_action('settings_page_s...') #13 {main} thrown in C:\apache\htdocs\wordpress\wp-content\plugins\slog\libs\class-slog-reports-form.php on line 189

Develop JavaScript alternative to vt-driver.php

The Slog admin page has tabs to view reports, compare results etc.
It doesn't yet have the ability to run performance tests.
It would be nice to be able to drive the performance comparison testing directly from the Slog admin page.

Requirements

There would be two methods

  1. Run the same query limit times.
  2. Run a set of queries from a filtered file, performing up to limit times.

Proposed solution

MVP

  • Develop a Driver tab that runs XMLHttpRequests to the server
  • Support a loop that will run the request limit times
  • Provide visual feedback so show that the loop is working and the results

Optional extras

  • Make it easily cancellable
  • Prevent the Run button from being pressed multiple times
  • Support loading a filtered file to provide the URLs for each request
  • Dynamically display the results in a chart
  • Allow setting of the daily trace summary file name from the Driver tab

Assumptions, Limitations, Questions

  • It'll be easier to write using XMLHttpRequests than fetch().
  • I can write it using native JavaScript
  • No need to use React / Gutenberg - how possible would that be anyway?
  • No need for internationalization.
  • Logic only needed for admin.
  • It'll be easy to write as plain HTML and JavaScript then convert to WordPress
  • Could most of the driver logic be written as ALL JavaScript?
  • Is CSS needed to style the output?

Slog search

Add a new tab that will allow searching of the Daily Trace Summary files for a particular string
be it an IP address, request type or whatever.

Requirements

  • Ability to search multiple daily trace summary files
  • Display results in the browser
  • Allow files to be viewed

Proposed solution

  • New Search tab
  • Input field for the search string
  • Output to include records found, count of occurrences, filenames.

Consider whether or not to search for particular fields OR just do a simple strpos().
Also decide how to choose which files to search.
Multi select list or just the whole shebang.

Group values every n hundredths of a second between 0 and max seconds

In issue #9 the logic was to group the values every 0.05 of a second ( 1/20th ) with a maximum value of 5 seconds.
This was fine for slower servers where most responses ranged between 1.5 and 3 seconds but wasn't any good where the average response was a lot less.
We need to be able to set the interval to every n hundredths of a second and reduce the maximum seconds for the final grouping accordingly.

Note: In the top-12 reports produced in Jan 2016 the displayed selection also had a starting value other than 0.

Warning: Undefined array key messages

When visiting the Slog admin page ( s.b/wordpress ) I got two warnings displayed when the fields on the Settings page hadn't been saved.

Expected result

No Warnings

Actual result

Warning: Undefined array key "_slog_downloads_dir" in \libs\class-slog-admin.php on line 48

Warning: Undefined array key "_slog_remote_url" in libs\class-slog-admin.php on line 49

Workaround

Save settings, even if the fields are blank.

Need ability to export chart data to a CSV file

The Charts displayed in the Slog admin tabs are produced by chart.js and are interactive.
If you click on the legend then it toggles the display of the line.
This can make it easier to highlight the data you're most interested in looking at.
eg For the top 12 WordPress plugin comparison we might want to focus on the effect of Yoast SEO, WooCommerce and Jetpack.

I want to be able to copy the chart data to the clipboard or a CSV file to be able to display the charts elsewhere
They will have to be sites which are using the sb-chart-block plugin.

Requirement

To be able to download the table as a CSV file.

Proposed solution

  • Button to request that the CSV results be copied to the clipboard
  • The clipboard can then be pasted to the sb-chart-block.

Find IPs to block by counting the number of login requests per IP

On a newish site I noticed thousands of requests to wp-login.php from the same IP address. The only thing this site was trying to do was login, using a dictionary lookup for passwords.

Blocking the IP reduced the number of requests to the site to a manageable level.

I realised that it would be easy to detect the IPs that should be blocked simply on the type of requests they perform.

Requirement

  1. Routine to analyse the daily summary report to find IPs that should be blocked.
  2. Some automated routine to be proactive rather than reactive.

I imagine Jetpack's Protect does something similar. And maybe Wordfence as well.

Can we run a greeness check using an improved slog driver?

Is there any point in attempting to write some code that repeats what Lighthouse can do, with regards to measuring your website performance?

How can we measure the "page size" and other values that are calculated by the tools mentioned by Hannah Smith at WP_Hooked tonight?

ecograder.com
ecoping.earth
digitalbeacon.co
websitecarbon.com

What does Query Monitor do?

Can we remind user to run the tests while plugged in?

Earlier today I ran some tests to measure the performance overhead of WooCommerce.

  • woocommerce.20211025 are the results for WooCommerce activated
  • nowooreally20211025 are the results for oik-unloader deactivating WooCommerce

When compared against results from yesterday noseonotrace.20211024 each invocation took significantly longer.

I realised / guessed this was because I was running my laptop using battery power.
I plugged in and re-ran the tests.

  • nowoopower.20211025 are the results when WooCommerce and Yoast SEO are deactivated by oik-unloader
  • woopower.20211025 shows the results when oik-unloader is not active; both WooCommerce and Yoast SEO loaded

image

Merge slog-bloat admin into slog - leaving slog-bloat with the historical gumph

While filtering daily trace summary files to create files to drive the performance analysis routines on a remote server
I find myself toggling between slog and slog-bloat. Sometimes I want to see the request types in the ( downloaded ) daily trace summary file.
It would be nice if the charts/reports in slog were easily accessible from slog-bloat.

Requirement

  • Ability to run slog reports against filtered / downloaded files
  • Make slog and slog bloat easier to use
  • Reduce complexity

Current position

  • Both slog and slog bloat are dependent upon oik-bwtrace and sb-chart-block.
  • Both use shared library functions
  • slog's admin was written as procedural code
  • slog-bloat's admin is better structured
  • slog-bloat is dependent upon slog
  • slog-bloat relies on slog's oik_autocode logic - is this true?

Proposed solution

  • Extend slog's file list to include files in slog-bloat's downloaded directory ( slog_bloat_options[_slog_downloads_dir] )
  • Cater for the Download directory not being specified, or blank.

I've decided this is a sensible idea.

The final outcome being that:

  • slog will do the charting stuff
  • either slog-bloat will contain the oik-batch vt-driver.php logic or it's merged into slog.
  • slog-bloat will retain the historical results.

Steps to achieving this:

  • Refactor the slog report logic to be object oriented as a Reports tab under slog-bloat.
  • Rework the settings logic so that the options are only updated on the Settings tab.
  • Remove slog-bloat's dependency on slog.
  • When the refactoring is complete copy slog-bloat logic to slog.
  • Eliminate admin logic from slog-bloat

Group values for every 0.05 second interval between 0 and 5 seconds

For slog-bloat I need the figures for each file being compared and need to know how many requests were dealt with in each interval of 1/20th of a second ( 0.05 secs ).
Otherwise the chart goes well wrong.
It's quite pretty... but useless.

  1. Sort sequence on the x-axis is wrong
  2. Labels are wrong
  3. Values shouldn't drop to 0 for accumulated percentages!

image

These changes also apply to the Elapsed chart displayed in slog.

Use autoload rather than depend on wp-top12

It should be possible to run slog and slog-bloat without wp-top12.

Requirement

slog and slog-bloat to be mostly standalone

Proposed solution

  • Implement oik_autoload
  • Remove calls to oik_require for files from wp-top12
  • Convert slog_admin_* functions to class Slog_Admin

Provide admin / backend interface for handling daily trace summary report files

After a while there is a build up of files named bwtrace.vt.yymmdd and, for multisite additional files bwtrace.vy.yymmdd.id. It would be nice to have some backend logic to help manage them.

Once the files have been safely extracted from the server they are no longer needed, so a delete facility would be nice. It would require an admin interface and/or an AJAX/REST one as we need to restrict processing to authorised users.

Develop charts for Daily Trace Summary files

A while ago, the logic written in vt.php was copied and cobbled into wp-top12.
It was extended as vt-stats.php and vt-top12.php.
Both routines produce CSV files summarising daily trace output in a variety of ways.
See the readme file for https://github.com/bobbingwide/wp-top12

I now want to convert the batch routines into Admin pages that extend oik-bwtrace.
and provide a variety of charts to be displayed in the Dashboard.
The admin pages will allow the user to select the required analysis.

Requirement

  • Ability to analyse the Daily Trace Summary reports in the WordPress dashboard
  • Choose the file or files to be analysed.
  • Choose from a range of reports

Proposed solution

  • Add an admin page
  • Support WordPress Multi Site summary trace files
  • Use/extend code from files in wp-top12 and pompey-chart
  • Eventually the code will have to be converted to shared libraries.

The admin page will display:

  • A form for input file and chart selection.
  • Selected chart
  • The chart's raw data in tabular form.

Form fields

Name Selection fields Values
file File to analyse List of daily trace summary files
report Report See Reports below
type Chart type Line, Bar, Pie
display Display values Count, Elapsed, Average, Percentage count, Percentage elapsed, Accumulated count percentage, Accumulated elapsed percentage
having Having Select groups having greater or equal to the given number of items

Reports

Report Displays
Request types Requests classified by type
Stripped Request URIs Grouped by the Uniform Resource Identifier
Stripped Request URIs Top Level Grouped by the first part of the Uniform Resource Identifier
Elapsed Grouped by Elapsed execution time ( in twentieth's of a second ).
Hook counts Grouped by Hook counts
Remote IP Grouped by IP address
Hourly Grouped by time in the day

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.