[R-pkg-devel] Checking the number of cores used

Ivan Krylov kry|ov@r00t @end|ng |rom gm@||@com
Wed Sep 20 11:08:32 CEST 2023


20 сентября 2023 г. 8:27:31 UTC, Shu Fai Cheung <shufai.cheung using gmail.com> пишет:

>Third, the "testthat.Rout" file only shows the total time:
>
>> proc.time()
>   user  system elapsed
> 13.530   0.291  29.492
>
>I believe the user time is not useful as we can use two processes in
>testthat. How can we detect the use of more than two cores in the
>tests?
R could report CPU and elapsed tme for each test file in tests/*.R, but with testthat, it only sees tests/testthat.R, which isn't very useful.

If you know R6, it should be possible to implement a CPUTimeReporter that would collect information about CPU and "wallclock" time taken by each individual test: https://testthat.r-lib.org/reference/Reporter.html

It may be worth submitting a feature request for such a reporter.
-- 
Best regards,
Ivan



More information about the R-package-devel mailing list