-
Notifications
You must be signed in to change notification settings - Fork 1
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
QOL Improvements #63
QOL Improvements #63
Conversation
…and have that be done on the frontend instead
@ingeniumed I reviewed your changes (and the deletion dialog changes) and they worked great! I also pushed up an optimization change in 0ee148e. I was curious now that private static $get_custom_status_count = 0;
private static $get_custom_status_duration = 0;
public static function get_custom_statuses(): array {
if ( HelperUtilities::is_current_post_type_unsupported() ) {
return self::get_core_statuses();
}
$start_time = microtime( true );
// ... do get_custom_statuses() logic
$end_time = microtime( true );
$duration = $end_time - $start_time;
self::$get_custom_status_duration += $duration;
++self::$get_custom_status_count;
error_log( sprintf( 'get_custom_status() called %d times (%0.4fs) ', self::$get_custom_status_count, self::$get_custom_status_duration ) );
return $statuses;
} I also generated ~1000 posts with a variety of statuses to test: ResultsOn the Admin -> Posts -> All Posts page (pictured above),
Curiously, checking the time for the first load ( I spent a bit debugging to see if there were any obvious functions that were responsible for the huge number of calls, and found that absolutely there was.
As a result of this small optimization, we save about 4x the number of calls to I also tested I'm going to merge this PR for now, but let me know if you have any disagreements with the optimization or implementation. Thanks! |
Description
This builds on #59 by making some QOL improvements.
log2logstash
within mu-plugins to send logs straight to logstash. This will only work on a VIP site which is what we are building for. This is only used in the notifications module right now, as we want users to know when emails or webhook notifications cannot be sent.Steps to Test