-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathperformance_maps.Rmd
83 lines (57 loc) · 2.34 KB
/
performance_maps.Rmd
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
---
title: "bupaR Docs | Performance Maps"
---
```{r echo = F, out.width="25%", fig.align = "right"}
knitr::include_graphics("images/icons/pm.PNG")
```
***
# Performance profile
```{r include = F}
library(bupaverse)
knitr::opts_chunk$set(fig.height=3)
knitr::opts_chunk$set(warning = F)
knitr::opts_chunk$set(out.width = "100%")
```
```{r eval = F}
library(bupaverse)
```
Instead of a frequencies, __process maps__ can also be used to visualize performance of the process, by using `performance()` to configure the map, instead of `frequency()`.
```{r}
patients %>%
process_map(performance())
```
There are three different parameters specific to the `performance()` configuration: the aggregation function, the time units, and the flow time type.
## Aggregation function
The `FUN` argument specifies the aggregation function to apply on the processing time (e.g. min, max, mean, median, etc.). By default, the _mean_ durations are shown. We can adjust this to the maximum, for example.
```{r}
patients %>%
process_map(performance(FUN = max))
```
Any function that takes a numerical vector and returns a single value can be used. For example, let's say we want to show the 0.90 percentile.
```{r}
p90 <- function(x, ...) {
quantile(x, probs = 0.9, ...)
}
patients %>%
process_map(performance(FUN = p90))
```
Note that the `...` is mandatory as `process_map()` will automatically add `na.rm = T` to the aggregation function call.
## Time units
The `units` argument allows to specify the time units to be used.
```{r fig.height=2}
patients %>%
process_map(performance(mean, "days"))
patients %>%
process_map(performance(mean, "hours"))
```
## Flow time type
Finally, you can set the `flowt_time` argument.
There are two different duration types that can be displayed on the edges:
* `idle_time`: the time between the end of the source activity, and the start of the target activity. Can be negative if the source activity overlaps with the target activity.
* `inter_start_time`: the time between the __start__ of the source- and target activities, __including__ the duration of the from-activity.
```{r footer, results = "asis", echo = F}
CURRENT_PAGE <- stringr::str_replace(knitr::current_input(), ".Rmd",".html")
res <- knitr::knit_expand("_button_footer.Rmd", quiet = TRUE)
res <- knitr::knit_child(text = unlist(res), quiet = TRUE)
cat(res, sep = '\n')
```