ps() Attributes Vector
psAttributes.names <- c("thread id",
"elapsed time",
"cpu time",
"input",
"output",
"error"
"command",
"frames",
"toplevel"
)
psAttributes <- 2^(c((1:length(psAttributes.names))-1))
names(psAttributes) <- psAttributes.names
The use of the values 2^(c((1:length(psAttributes.names))-1))
allows us to do relatively quick OR(|)ing of the values to include.
The user can specify the attributes s/he wants in the output
in the following way
ps(attributes=c("thread id", "frames"))
is mapped to
if(is(attributes,"character"))
val = sum(psAttributes[attributes])
else if(is(attributes,"numeric")) {
# check the values agains those in psAttributes
if(any(is.na(match(attributes,psAttributes))))
stop("incorrect values passed as attributes to ps")
val = sum(attributes)
}
- thread id
- the thread name used internally and by which the thread can be referenced.
This is also the value in the thread object's name slot.
- elapsed time
- the length of time since the creation of the thread
- cpu time
- the length of time for the evaluation of this thread
- input
- the input connection for this thread, typically NULL.
- output
- the output connection for this thread
- error
- the error connection for this thread on which warnings and errors are printed.
- command
- the current command or if this is too difficult, the command that
constituted the first task for this thread.
- frames
- session frames and/or databases associated with this thread. Each thread
will have at least one of these databases for its own use.
- toplevel
- the identifier of the database to which toplevel assignments in this frame
are committed.
Last modified: Thu Feb 6 09:53:00 1997