Bugzilla – Attachment 142917 Details for
Bug 28172
Optimize Koha::Plugins::GetPlugins
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28172: [DO NOT PUSH] Test script for GetPlugins
Bug-28172-DO-NOT-PUSH-Test-script-for-GetPlugins.patch (text/plain), 1.60 KB, created by
Julian Maurice
on 2022-11-02 08:50:03 UTC
(
hide
)
Description:
Bug 28172: [DO NOT PUSH] Test script for GetPlugins
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2022-11-02 08:50:03 UTC
Size:
1.60 KB
patch
obsolete
>From a990bc4de293141e3a955e5a0e8efce41b69147c Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Tue, 20 Apr 2021 09:11:53 +0200 >Subject: [PATCH] Bug 28172: [DO NOT PUSH] Test script for GetPlugins > >--- > test_getplugins.pl | 41 +++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 41 insertions(+) > create mode 100755 test_getplugins.pl > >diff --git a/test_getplugins.pl b/test_getplugins.pl >new file mode 100755 >index 0000000000..ecb65c8483 >--- /dev/null >+++ b/test_getplugins.pl >@@ -0,0 +1,41 @@ >+#!/usr/bin/perl >+ >+use Modern::Perl; >+ >+use Koha::Plugins; >+use Time::HiRes qw(gettimeofday tv_interval); >+use Data::Dumper; >+ >+my $plugins = Koha::Plugins->new; >+ >+sub test { >+ my ($description, $sub) = @_; >+ my $t0 = [gettimeofday]; >+ $sub->(); >+ my $elapsed = tv_interval($t0); >+ say sprintf('%s: %.3fs', $description, $elapsed); >+} >+ >+test('First 2 calls to GetPlugins', sub { >+ my @all_plugins = $plugins->GetPlugins({ all => 1 }); >+ my @enabled_plugins = $plugins->GetPlugins(); >+ say sprintf('%d plugins detected, %d enabled', scalar @all_plugins, scalar @enabled_plugins); >+}); >+ >+test('1000 calls to GetPlugins', sub { >+ for (1..1000) { >+ my @plugins = $plugins->GetPlugins({ method => 'get_metadata' }); >+ } >+}); >+ >+test('1000 calls to GetPlugins with method = "unknown_method"', sub { >+ for (1..1000) { >+ my @plugins = $plugins->GetPlugins({ method => 'unknown_method' }); >+ } >+}); >+ >+test('1000 calls to GetPlugins with all = 1', sub { >+ for (1..1000) { >+ my @plugins = $plugins->GetPlugins({ all => 1 }); >+ } >+}); >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28172
:
119870
|
119871
| 142917 |
142918