1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>progressr: Debug</title>
<style>
body {
font-family: sans-serif;
line-height: 1.6;
padding-left: 3ex;
padding-right: 3ex;
background-color: white;
color: black;
}
a {
color: #4183C4;
text-decoration: none;
}
h1, h2, h3 {
margin: 2ex 0 1ex;
padding: 0;
font-weight: bold;
-webkit-font-smoothing: antialiased;
cursor: text;
position: relative;
}
h2 {
border-bottom: 1px solid #cccccc;
}
code {
margin: 0 2px;
padding: 0 5px;
white-space: nowrap;
border: 1px solid #eaeaea;
background-color: #f8f8f8;
border-radius: 3px;
}
pre code {
margin: 0;
padding: 0;
white-space: pre;
border: none;
background: transparent;
}
pre {
background-color: #f8f8f8;
border: 1px solid #cccccc;
line-height: 2.5x;
overflow: auto;
padding: 0.6ex 1ex;
border-radius: 3px;
}
pre code {
background-color: transparent;
border: none;
}
</style>
</head>
<body>
<h1>progressr: Debug</h1>
<!--
%\VignetteIndexEntry{progressr: Debug}
%\VignetteAuthor{Henrik Bengtsson}
%\VignetteKeyword{R}
%\VignetteKeyword{package}
%\VignetteKeyword{vignette}
%\VignetteKeyword{debugging}
%\VignetteEngine{progressr::selfonly}
-->
<p>Progress updates generated by <strong><a href="https://progressr.futureverse.org">progressr</a></strong> are formally R conditions
of class <code>progression</code> that are signaled and handled by R's condition
framework. Sometimes these <code>progression</code> conditions are not signaled,
or transmitted, as expected. To troubleshoot such problems, we can use
the built-in "debug" handler. For example,</p>
<pre><code class="language-r">> library(progressr)
> handlers("debug")
> handlers(global = TRUE)
>
> y <- slow_sum(1:3)
[21:17:01.786] (0.000s => +0.015s) initiate: 0/3 (+0) '' {clear=TRUE, enabled=TRUE, status=}
[21:17:01.975] (0.189s => +0.179s) update: 0/3 (+0) '' {clear=TRUE, enabled=TRUE, status=}
[21:17:02.378] (0.593s => +0.002s) update: 0/3 (+0) '' {clear=TRUE, enabled=TRUE, status=}
[21:17:02.581] (0.796s => +0.002s) update: 1/3 (+1) 'P: Adding 1' {clear=TRUE, enabled=TRUE, status=}
M: Added value 1
[21:17:02.788] (1.002s => +0.004s) update: 1/3 (+0) 'P: Adding 1' {clear=TRUE, enabled=TRUE, status=}
[21:17:02.990] (1.205s => +0.001s) update: 1/3 (+0) 'P: Adding 1' {clear=TRUE, enabled=TRUE, status=}
[21:17:03.394] (1.608s => +0.002s) update: 1/3 (+0) 'P: Adding 1' {clear=TRUE, enabled=TRUE, status=}
[21:17:03.597] (1.812s => +0.002s) update: 2/3 (+1) 'P: Adding 2' {clear=TRUE, enabled=TRUE, status=}
M: Added value 2
[21:17:03.807] (2.021s => +0.007s) update: 2/3 (+0) 'P: Adding 2' {clear=TRUE, enabled=TRUE, status=}
[21:17:04.010] (2.224s => +0.001s) update: 2/3 (+0) 'P: Adding 2' {clear=TRUE, enabled=TRUE, status=}
[21:17:04.412] (2.627s => +0.001s) update: 2/3 (+0) 'P: Adding 2' {clear=TRUE, enabled=TRUE, status=}
[21:17:04.616] (2.830s => +0.002s) update: 3/3 (+1) 'P: Adding 3' {clear=TRUE, enabled=TRUE, status=}
[21:17:04.618] (2.832s => +0.004s) update: 3/3 (+0) 'P: Adding 3' {clear=TRUE, enabled=TRUE, status=}
M: Added value 3
>
</code></pre>
</body>
</html>
|