rsb.introspection¶
This package contains partial introspection functionality for RSB.
The introspection functionality is implemented in terms of RSB events and thus built on top of “ordinary” RSB communication.
This package implements the “local introspection” (i.e. introspection sender) part of the introspection architecture.
Code author: jmoringe
Functions
getLoggerByClass (klass) |
Get a python logger instance based on a class instance. |
handleParticipantCreation (participant[, parent]) |
This function is intended to be connected to rsb.participantCreationHook and calls IntrospectionSender.addParticipant when appropriate, first creating the IntrospectionSender instance, if necessary. |
handleParticipantDestruction (participant) |
This function is intended to be connected to rsb.participantDestructionHook and calls IntrospectionSender.removeParticipant when appropriate, potentially deleting the IntrospectionSender instance afterwards. |
hostId () |
Returns a unique id string for the current host. |
initialize ([displayName]) |
Initializes the introspection module. |
machineType () |
|
machineVersion () |
|
participantScope (participantId[, baseScope]) |
|
processScope (hostId, processId[, baseScope]) |
|
processStartTime () |
Return the start time of the current process (or an approximation) in fractional seconds since UNIX epoch. |
programName () |
Classes
Bye (**kwargs) |
|
Hello (**kwargs) |
|
HostInfo ([id, hostname, machineType, ...]) |
Instances of this class store information about a host. |
IntrospectionSender () |
Instances of this class (usually zero or one per process) send information about participants in the current process, the current process itself and the local host to receivers of introspection information. |
ParticipantInfo (kind, id, scope, type[, ...]) |
Instances of this class store information about a participant. |
ProcessInfo ([id, programName, arguments, ...]) |
Instances of this class store information about operating system processes. |
-
class
rsb.introspection.
HostInfo
(id=None, hostname='jampal', machineType='x86_64', machineVersion=None, softwareType='darwin', softwareVersion='13.4.0')¶ Bases:
object
Instances of this class store information about a host.
The stored information can describe the local host or a remote host.
Code author: jmoringe
-
getId
()¶ Return the unique id string for the host.
Returns: The platform-dependent, (hopefully) unique id string. Return type: str or None
-
getMachineType
()¶ Return the type of the machine, usually CPU architecture.
Returns: The machine type when known. Return type: str or NoneType
-
getMachineVersion
()¶ Returns the version of the machine within its type, usually the CPU identification string.
Returns: The machine version when known. Return type: str or NoneType
-
getSoftwareType
()¶ Returns the type of the operating system running on the host, usually the kernel name.
Returns: The software type when known. Return type: str or NoneType
-
getSoftwareVersion
()¶ Returns the version of the operating system within its type, usually the kernel version string.
Returns: The software version when known. Return type: str or NoneType
-
id
¶ Return the unique id string for the host.
Returns: The platform-dependent, (hopefully) unique id string. Return type: str or None
-
machineType
¶ Return the type of the machine, usually CPU architecture.
Returns: The machine type when known. Return type: str or NoneType
-
machineVersion
¶ Returns the version of the machine within its type, usually the CPU identification string.
Returns: The machine version when known. Return type: str or NoneType
-
-
class
rsb.introspection.
IntrospectionSender
¶ Bases:
object
Instances of this class (usually zero or one per process) send information about participants in the current process, the current process itself and the local host to receivers of introspection information.
Instances need to be notified of created and destroyed participants via calls of the
addParticipant
andremoveParticipant
methods.Code author: jmoringe
-
addParticipant
(participant, parent=None)¶
-
deactivate
()¶
-
getHost
()¶
-
getProcess
()¶
-
removeParticipant
(participant)¶
-
sendBye
(participant)¶
-
sendHello
(participant, query=None)¶
-
sendPong
(participant, query=None)¶
-
host
¶
-
process
¶
-
-
class
rsb.introspection.
ParticipantInfo
(kind, id, scope, type, parentId=None, transportURLs=None)¶ Bases:
object
Instances of this class store information about a participant.
The participant can reside in the current process or in a remote process.
Code author: jmoringe
-
getId
()¶ Returns the unique id of the participant.
Returns: The unique id of the participant. Return type: uuid.uuid
-
getKind
()¶ Returns the kind of the participant.
Examples include “listener”, “informer” and “local-server”.
Returns: A lower-case, hyphen-separated string identifying the kind of participant. Return type: str
-
getParentId
()¶ Return the unique id of the parent participant of the participant, or
None
, if the participant does not have a parent.Returns: None
or the unique id of the participant’s parent.Return type: uuid.uuid or NoneType
-
getScope
()¶ Returns the scope of the participant.
Returns: The scope of the participant. Return type: rsb.Scope
-
getTransportURLs
()¶ Return list of transport URLs.
Returns: List of transport URLs describing the transports used by the participant. Return type: list
-
getType
()¶ Returns a representation of the type of the participant, if available.
Note that this is a temporary solution and will change in future versions.
Returns: A representation of the type. Return type: type or tuple
-
id
¶ Returns the unique id of the participant.
Returns: The unique id of the participant. Return type: uuid.uuid
-
kind
¶ Returns the kind of the participant.
Examples include “listener”, “informer” and “local-server”.
Returns: A lower-case, hyphen-separated string identifying the kind of participant. Return type: str
-
parentId
¶ Return the unique id of the parent participant of the participant, or
None
, if the participant does not have a parent.Returns: None
or the unique id of the participant’s parent.Return type: uuid.uuid or NoneType
-
scope
¶ Returns the scope of the participant.
Returns: The scope of the participant. Return type: rsb.Scope
-
-
class
rsb.introspection.
ProcessInfo
(id=58152, programName='python2.7 /Users/jenkins/workspace/rsb-manual-0.14/env/bin/sphinx-build', arguments=['/Users/jenkins/workspace/rsb-manual-0.14/env/bin/sphinx-build', '-b', 'html', '-c', '/Users/jenkins/workspace/rsb-manual-0.14/rsb-manual/build', '/Users/jenkins/workspace/rsb-manual-0.14/rsb-manual', '/Users/jenkins/workspace/rsb-manual-0.14/rsb-manual/build/html'], startTime=1491344155.434984, executingUser=None, rsbVersion='0.14.1-gcdf638a')¶ Bases:
object
Instances of this class store information about operating system processes.
The stored information can describe the current process, a different process on the local machine or a remote process.
Code author: jmoringe
-
getArguments
()¶ Returns the list of commandline argument the process has been started with.
Returns: A list of commandline argument strings Return type: list
-
getExecutingUser
()¶ Return the login- or account-name of the user executing the process.
Returns: login- or account-name of the user executing the process or None if not determinable Return type: str
-
getId
()¶ Returns the numeric id of the process.
Returns: The numeric id of the process. Return type: int
-
getProgramName
()¶ Returns the name of the program being executed in the process.
Returns: The name of the program. Return type: str
-
getRSBVersion
()¶ Return the version of the RSB implementation used in this process.
Returns: Version string of the form: MAJOR.MINOR.REVISION[-COMMIT]
Return type: str
-
getStartTime
()¶ Returns the start time of the process in fractional seconds since UNIX epoch.
Returns: start time in fractional seconds since UNIX epoch. Return type: float
-
arguments
¶ Returns the list of commandline argument the process has been started with.
Returns: A list of commandline argument strings Return type: list
-
executingUser
¶ Return the login- or account-name of the user executing the process.
Returns: login- or account-name of the user executing the process or None if not determinable Return type: str
-
programName
¶ Returns the name of the program being executed in the process.
Returns: The name of the program. Return type: str
-
-
rsb.introspection.
handleParticipantCreation
(participant, parent=None)¶ This function is intended to be connected to
rsb.participantCreationHook
and callsIntrospectionSender.addParticipant
when appropriate, first creating theIntrospectionSender
instance, if necessary.
-
rsb.introspection.
handleParticipantDestruction
(participant)¶ This function is intended to be connected to
rsb.participantDestructionHook
and callsIntrospectionSender.removeParticipant
when appropriate, potentially deleting theIntrospectionSender
instance afterwards.
-
rsb.introspection.
hostId
()¶ Returns a unique id string for the current host.
Returns: A platform-dependent, string (hopefully) uniquely identifying the current host or None
if such an id cannot be obtained.Return type: str or NoneType
-
rsb.introspection.
initialize
(displayName=None)¶ Initializes the introspection module. Clients need to ensure that this method is called only once.
Parameters: displayName (str or NoneType if not set, optional) – a user-defined process name to use in the introspection
-
rsb.introspection.
machineType
()¶
-
rsb.introspection.
machineVersion
()¶
-
rsb.introspection.
participantScope
(participantId, baseScope=Scope("/__rsb/introspection/participants/"))¶
-
rsb.introspection.
processScope
(hostId, processId, baseScope=Scope("/__rsb/introspection/hosts/"))¶
-
rsb.introspection.
processStartTime
()¶ Return the start time of the current process (or an approximation) in fractional seconds since UNIX epoch.
Returns: Start time in factional seconds since UNIX epoch. Return type: float
-
rsb.introspection.
programName
()¶