|
14 | 14 | #' @return |
15 | 15 | #' A data frame of class `FutureJournal` with columns: |
16 | 16 | #' |
17 | | -#' 1. `event` (character string) - type of event that took place |
18 | | -#' 2. `category` (character string) - the category of the event |
19 | | -#' 3. `parent` (character string) - (to be describe) |
20 | | -#' 4. `start` (POSIXct) - the timestamp when the event started |
21 | | -#' 5. `at` (difftime) - the time when the event started relative to |
22 | | -#' first event |
23 | | -#' 6. `duration` (difftime) - the duration of the event |
| 17 | +#' 1. `event` (factor) - type of event that took place |
| 18 | +#' 2. `category` (factor) - the category of the event |
| 19 | +#' 3. `parent` (character string) - (to be describe) |
| 20 | +#' 4. `start` (POSIXct) - the timestamp when the event started |
| 21 | +#' 5. `at` (difftime) - the time when the event started |
| 22 | +#' relative to first event |
| 23 | +#' 6. `duration` (difftime) - the duration of the event |
24 | 24 | #' 7. `future_label` (character string) - the label of the future |
25 | | -#' 8. `future_uuid` (character string) - the UUID of the future |
26 | | -#' 9. `session_uuid` (character string) - the UUID of the R session |
27 | | -#' where the event took place |
| 25 | +#' 8. `future_uuid` (factor) - the UUID of the future |
| 26 | +#' 9. `session_uuid` (factor) - the UUID of the R session where the |
| 27 | +#' event took place |
28 | 28 | #' |
29 | 29 | #' The common events are: |
30 | 30 | #' |
31 | | -#' * `create` - the future was created (an `overhead`) |
32 | | -#' * `launch` - the future was launched (an `overhead`) |
| 31 | +#' * `create` - the future was created (an `overhead`) |
| 32 | +#' * `launch` - the future was launched (an `overhead`) |
33 | 33 | #' * `evaluate` - the future was evaluated (an `evaluation`) |
34 | 34 | #' * `resolved` - the future was queried (may be occur multiple times) |
35 | 35 | #' (an `overhead`) |
36 | | -#' * `gather` - the results was retrieved (an `overhead`) |
| 36 | +#' * `gather` - the results was retrieved (an `overhead`) |
37 | 37 | #' |
38 | 38 | #' but others may be added by other Future classes. |
39 | 39 | #' |
40 | | -#' Common event categorys are: |
| 40 | +#' Common event categories are: |
41 | 41 | #' |
42 | 42 | #' * `evaluation` - processing time is spent on evaluation |
43 | | -#' * `overhead` - processing time is spent on orchestrating the future |
44 | | -#' * `waiting` - processing time is spent on waiting to set up or |
| 43 | +#' * `overhead` - processing time is spent on orchestrating the future |
| 44 | +#' * `waiting` - processing time is spent on waiting to set up or |
45 | 45 | #' querying the future |
46 | 46 | #' |
47 | 47 | #' but others may be added by other Future classes. |
@@ -82,10 +82,10 @@ journal.Future <- function(x, ...) { |
82 | 82 | if (!is.element("evaluate", data$event) && !is.null(x$result)) { |
83 | 83 | stop_if_not(is.character(session_uuid)) |
84 | 84 | x <- appendToFutureJournal(x, |
85 | | - event = "evaluate", |
86 | | - category = "evaluation", |
87 | | - start = x$result$started, |
88 | | - stop = x$result$finished |
| 85 | + event = "evaluate", |
| 86 | + category = "evaluation", |
| 87 | + start = x$result$started, |
| 88 | + stop = x$result$finished |
89 | 89 | ) |
90 | 90 | data <- x$.journal |
91 | 91 | stop_if_not(length(x$result$session_uuid) == 1L, is.character(x$result$session_uuid)) |
@@ -117,6 +117,14 @@ journal.Future <- function(x, ...) { |
117 | 117 | levels <- c(known_levels, other_levels) |
118 | 118 | data$event <- factor(data$event, levels = levels) |
119 | 119 |
|
| 120 | + ## Coerce 'category' to a factor |
| 121 | + levels <- c("evaluation", "overhead", "waiting") |
| 122 | + data$category <- factor(data$category, levels = levels) |
| 123 | + |
| 124 | + ## Coerce 'category' to a factor |
| 125 | + levels <- c("evaluation", "overhead", "waiting") |
| 126 | + data$category <- factor(data$category, levels = levels) |
| 127 | + |
120 | 128 | ## Sort by relative start time |
121 | 129 | if (nrow(data) > 1L) data <- data[order(data$at), ] |
122 | 130 |
|
|
0 commit comments