Skip to content

Commit

Permalink
Add memory used to uptime command
Browse files Browse the repository at this point in the history
Also log the output of the uptime command at the end of a test run for
each bot.

Addresses part of Raku#197.
  • Loading branch information
MasterDuke17 committed Sep 20, 2017
1 parent 69330d1 commit c6aa350
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Whateverable.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ multi method irc-to-me(Message $msg where .text ~~ /:i^ help ‘?’? $/) {
}
multi method irc-to-me(Message $msg where .text ~~ /:i^ uptime $/) {
use nqp;
(denominate now - INIT now) ~ .
(denominate now - INIT now) ~ ,
~ nqp::atpos_i(nqp::getrusage(), nqp::const::RUSAGE_MAXRSS).fmt(%.2f)/1000 ~ KB maxrss.
~ (with nqp::getcomp("perl6") {
This is {.implementation} version {.config<version>}
~ built on {.backend.version_string}
Expand Down
4 changes: 4 additions & 0 deletions t/lib/Testable.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ class Testable {
}

method end {
my $answer;
self.test(_, {$.bot-nick}: uptime, {$answer=$_; True});
logs/tests/$!bot-nick-{now.DateTime}.log.IO.spurt: $answer;

$!bot-proc.kill;
$!irc-client.quit;
sleep 2
Expand Down

0 comments on commit c6aa350

Please sign in to comment.