q.ls: list job log detail

Description Usage Arguments Examples

View source: R/q.ls.R

Description

discover current job queue data.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
q.ls()

d=q.ls('fail')      # failed process
q.run(d$jid)        # run it locally again

d=q.ls('success')   # sucess process
d=q.ls('progress')  # running process
d=q.ls('schedule')  # scheduled process

# view output in browser
q.ls('782f83ca-f134-41e5-9b93-3356a29f6d86', view.output = TRUE)

Arguments

jid

NULL is default that show all jobs or specific jid job or you can use keyword, 'success','fail','progress','schedule' by type

view.output

TRUE to open file in browser or editor

detail

TRUE to give full detail of job queue data attribute

Examples

 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
## Not run: 

# handling failure
RCode <- "stop (' Rmark down exception!!! ') "

# create rmarkdown test throw execption
jid <- q.push(name='test rmarkdown failer',
       code=RCode,
       params=list(debug=TRUE, other_param=123))

q.run(jid)

# show u what failed
q.ls('success', view.output = TRUE)

# gather runtime paramaters used to run rmarkdown script
myparam <- jid.params(jid)

# Rerun failed test
failed <- q.ls('failed', detail = TRUE) # grab detail report

q.reschudle(failed$jid, wday='Monday', hour=7 ) # rerun first failed test

# if still failed, check your script
rstudioapi::viewer(failed$script) # open & edit falied script

# remove this jid log
q.rm(jid)


# !! Keep Debuging!!!

# visualise failed and success test summary
require(ggplot2)

qlist <- q.ls()
plot.data <- qlist 

ggplot(data=plot.data,aes(x=name,y=secs,color=status)) + geom_boxplot() + ggtitle('job execution time') + theme_minimal() + xlab('job name')


## End(Not run)

okux/qrmarkdown documentation built on Dec. 22, 2021, 4:17 a.m.