]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei sucks: show nproc in CPU info
authorEric Wong <e@80x24.org>
Thu, 28 Oct 2021 11:15:00 +0000 (11:15 +0000)
committerEric Wong <e@80x24.org>
Thu, 28 Oct 2021 19:17:11 +0000 (19:17 +0000)
Some bugs are triggered with more CPUs, some with 1 CPU.

lib/PublicInbox/LeiSucks.pm

index e832f95e07367d28bfcea8e6a0c5b77d026b71ba..8e866fc96655a9dd5a6342de43217da0a57e14f5 100644 (file)
@@ -11,6 +11,7 @@ use Digest::SHA ();
 use Config;
 use POSIX ();
 use PublicInbox::Config;
+use PublicInbox::IPC;
 
 sub lei_sucks {
        my ($lei, @argv) = @_;
@@ -22,9 +23,10 @@ sub lei_sucks {
        }
        eval { require PublicInbox };
        my $pi_ver = eval('$PublicInbox::VERSION') // '(???)';
+       my $nproc = PublicInbox::IPC::detect_nproc() // '?';
        my @out = ("lei $pi_ver\n",
                "perl $Config{version} / $os $rel / $mac ".
-               "ptrsize=$Config{ptrsize}\n");
+               "ptrsize=$Config{ptrsize} nproc=$nproc\n");
        chomp(my $gv = `git --version` || "git missing");
        $gv =~ s/ version / /;
        my $json = ref(PublicInbox::Config->json);