Understanding R shiny user metrics

I am keen to download some usage metrics from my shiny apps to get a feel for how many people are using them. I see that there may be options to use google analytics, but i am not familiar with Java script.

I have tried to extract metrics using rsconnect:: as explained here https://docs.rstudio.com/shinyapps.io/metrics.html

My main issue (sorry if im being stupid here)...is that i simply don't understand what any of these metrics mean, or how to interpret the data I receive.

For example "connect_count" returns a column of 1/0s and a timestamp. But what does this mean? and how do i interpret the timestamp?

Any help would be really appreciated. Apologies again if this is a stupid question or if its covered elsewhere.

Andy

So, there's a table at the link you gave that should help (I'm pasting it below as well).
As you can see in the table, connect_count, represents the number of connections. If there is a time stamp, that represents the number of connections at that time (I'm not sure what the level of aggregation is by default) — a zero meaning none, and a one meaning one. So, if you wanted, you could analyze the time-series data at different levels of aggregation (e.g. the number of connections on a given day = the sum of the number of connections for all the hours in that day). This section from R for Data Science might help you with that.

Table 6.1: Available series and metrics

Series Metric Description
docker_container_cpu usage_in_usermode CPU usage in user space in nanoseconds
docker_container_cpu usage_in_kernelmode CPU usage in system time in nanoseconds
docker_container_net tx_bytes Network traffic transmitted from the application instances
docker_container_net rx_bytes Network traffic received by the application instances
docker_container_mem total_rss The amount of memory that does not correspond to anything on disk: stacks, heaps, and anonymous memory maps
docker_container_mem total_cache The amount of memory used that can be associated precisely with a block on a block device
container_status connect_count The number of connections
container_status connect_procs The number of worker processes
1 Like

Thanks for the rapid reply!

Could you please help explain the time stamp..... for example what does a time of "1560435060" mean?

Andy

That's a Unix epoch time. That one, for example, converts to Thursday, June 13, 2019 2:11:00 PM GMT (see Epoch Converter for a nice little online human-readable interface).
You can convert to POSIXct in base R by passing it along with the origin and time zone (see the R4DS link in my earlier reply for more detail) to as.POSIXct().

as.POSIXct(1560435060, origin="1970-01-01", tz="GMT")
#> [1] "2019-06-13 14:11:00 GMT"

or with lubridate

lubridate::as_datetime(1560435060)
#> [1] "2019-06-13 14:11:00 UTC"

Created on 2019-06-14 by the reprex package (v0.3.0)

1 Like

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.