Feature #1830

Feature #44: Implement basic introspection support

Initial support for participant hierarchies

Added by J. Moringen about 10 years ago. Updated over 9 years ago.

Status:ResolvedStart date:04/01/2014
Priority:NormalDue date:
Assignee:J. Moringen% Done:

100%

Category:Common Lisp
Target version:rsb-0.11

Associated revisions

Revision b55b2727
Added by J. Moringen over 9 years ago

Added parent parameter to participant creation functions in src/**/protocol.lisp

refs #1830

  • src/protocol.lisp (make-participant): accept parent keyword parameter;
    updated documentation string accordingly
    (make-participant-using-class :around class t scope): pass value of
    parent keyword parameter to make participant hook but not to the next
    method
    (make-listener): accept parent keyword parameter; updated
    documentation string accordingly
    (make-reader): likewise
    (make-informer): likewise
  • src/patterns/request-reply/protocol.lisp (make-remote-server):
    likewise
    (make-local-server): likewise
  • src/patterns/request-reply/server.lisp (define-lazy-creation-method):
    pass method as parent to created participants
  • src/patterns/request-reply/local-server.lisp (set-method): pass
    :parent initarg to created method
  • src/patterns/request-reply/remote-server.lisp (ensure-method):
    likewise
  • test/protocol.lisp (test hooks-root::make-participant-hook/smoke):
    added test cases involving a :parent initarg
  • test/listener.lisp (define-basic-participant-test-cases listener):
    test :parent initarg using `*simple-parent*'
  • test/listener.lisp (define-basic-participant-test-cases reader):
    likewise
  • test/informer.lisp (define-basic-participant-test-cases informer):
    likewise
  • test/package.lisp (package rsb.test): added exported
    symbol simple-parent
    (mock-participant): new class; mock participant without any behavior
    (register-participant-class mock-participant): register mock
    participant class
    (simple-parent): new variable; a mock participant that can be used
    in tests which need a parent participant
  • test/patterns/request-reply/local-server.lisp
    (define-basic-participant-test-cases local-server): test :parent
    initarg using `*simple-parent*'
  • test/patterns/request-reply/remote-server.lisp
    (define-basic-participant-test-cases :remote-server): likewise

Revision ac827101
Added by J. Moringen over 9 years ago

Added introspection model in src/introspection/model.lisp

refs #1740, refs #1744, refs #1830

Introspection model classes
  • for platform information: participants, processes and hosts.
  • for messages: hello and bye
  • src/introspection/types.lisp: new file; contains types used in the
    introspection module
  • src/introspection/protocol.lisp (info-most-recent-activity): new
    generic function; return timestamp of most recent activity on the
    instances
    (info-clock-offset): new generic function; return estimated clock
    offset
    (info-latency): new generic function; return estimated communication
    latency
    (participant-info-kind): new generic function; return kind of
    participant
    (participant-info-id): new generic function; return id of participant
    (participant-info-parent-id): new generic function; return id of the
    parent of the participant
    (participant-info-scope): new generic function; return scope of
    participant
    (participant-info-type): new generic function; return type of
    participant
    (participant-info-transports): new generic function; return list of
    transports of the participant
    (process-info-process-id): new generic function; return id of the
    process
    (process-info-program-name): new generic function; return program name
    of the process
    (process-info-commandline-arguments): new generic function; return
    commandline options of the process
    (process-info-start-time): new generic function; return start time of
    the process
    (process-info-state): new generic function; return state of the
    process
    (process-info-transports): new generic function; return list of
    transports via which the process has been contacted
    (host-info-id): new generic function; return id of host
    (host-info-hostname): new generic function; return hostname of host
    (host-info-state): new generic function; return state of host
    (hello-participant): new generic function; return participant-info of
    the message
    (hello-process): new generic function; return process-info of the
    message
    (hello-host): new generic function; return host-info of the message
    (bye-id): new generic function; return participant id of the message
  • src/introspection/model.lisp: new file; contains model classes for
    local and remote objects used by both local and remote introspection
  • src/introspection/package.lisp (package rsb.introspection): added
    exported symbols info-most-recent-activity, info-clock-offset,
    info-latency, participant-info, remote-participant-info,
    participant-info-kind, participant-info-id,
    participant-info-parent-id, participant-info-scope,
    participant-info-type, participant-info-transports, process-info,
    remote-process-info, process-info-process-id, process-info-state,
    process-info-program-name, process-info-transports,
    process-info-commandline-arguments, process-info-start-time,
    current-process-info, host-info, remote-host-info, host-info-id,
    host-info-state, host-info-hostname, current-host-info, hello,
    hello-participant, hello-process, hello-host, bye, and bye-id
  • test/introspection/model.lisp: new file; contains unit tests for the
    introspection model
  • rsb-introspection.asd (system rsb-introspection): added
    defsystem-dependency on cl-protobuf; added module "protocol" with
    files files rsb/protocol/introspection/{Hello,Bye}.proto; added files
    src/introspection/types.lisp and src/introspection/model.lisp
    (system rsb-introspection-test): added file
    test/introspection/model.lisp

Revision 90bc27a4
Added by J. Moringen over 9 years ago

Added local introspection in src/introspection/local-introspection.lisp

fixes #1740, refs #1830

Local introspection is implemented as a database container information
about the local host, the local process and local
participants. Participants are tracked by hooking into
`*make-participant-hook*' and
`*participant-state-change-hook*'. Changes, queries and requests are
processed using a listener, an informer and a local-server.

  • src/introspection/protocol.lisp (introspection-processes): new generic
    function; return processes of a container
    (find-process): new generic function; find a process in a container
    (setf find-process): new generic function; store a process in a
    container
    (ensure-process): new generic function; ensure a process exists in a
    container
    (introspection-hosts): new generic function; return hosts of a
    container
    (find-host): new generic function; find a host in a container
    (setf find-host):new generic function; store a host in a container
    (ensure-host): new generic function; ensure a hosts exists in a
    container
  • src/introspection/variables.lisp (survey-filter): new variable;
    stores a filter for introspection surveys
    (broadcast-filter): new variable; stores a filter for introspection
    broadcasts
    (introspection-host-converters): new variable; stores converters for
    host-related introspection communication
    (introspection-all-converters): new variable; stores converters for
    generic introspection communication
    (local-database): new variable; stores the local introspection
    database
    (local-database-lock): new variable; stores a lock protecting the
    local database
    (call-with-local-database): new function; call a thunk with the local
    database, creating and locking it if necessary/requested
    (with-local-database): new macro; similar
    (register-participant): new function; register a participant in the
    local introspection database
    (unregister-participant): new function; unregister a participant from
    the local introspection database
    (handle-make-participant): new function; handler for
    `*make-participant-hook*' that calls `register-participant' when
    appropriate
    (handle-participant-state-change): new function;
    (toplevel): register `*make-participant-hook*' and
    '*participant-state-change-hook*' handlers
  • src/introspection/local-introspection.lisp: new file; contains
    `introspection-sender' and `local-introspection'
  • src/introspection/package.lisp (package rsb.introspection): added
    exported symbols introspection-processes, find-process,
    ensure-process, introspection-hosts, find-host, and ensure-host
  • test/introspection/local-introspection.lisp: new file; contains unit
    test for `local-introspection' and related functionality
  • test/introspection/package.lisp (package rsb.introspection.test):
    added used package rsb.patterns.request-reply
  • rsb-introspection.asd (system rsb-introspection): added file
    src/introspection/local-introspection.lisp
    (system rsb-introspection-test): added file
    test/introspection/local-introspection.lisp

Revision 708c28e2
Added by J. Moringen over 9 years ago

Added remote introspection in src/introspection/remote-introspection.lisp

fixes #1744, fixes #1830, fixes #1833

The remote introspection implementation consists of three layers:
  • `introspection-receiver' handles the event protocol and dispatches
    broadcasts and replies
  • database object classes `{participant,process,host}-entry' are stored
    and maintained in a `remote-introspection-database'
  • `remote-introspection' is a participant class that ties everything
    together by instantiating and configuring `introspection-receiver'
    instances and a database and performing timed updates.
  • src/introspection/protocol.lisp (database-change-hook): new generic
    function; return the change hook of an introspection database object
    (introspection-survey): new generic function; survey remote objects
    (introspection-ping): new generic function; ping a remote object
    (entry-info): new generic function; return info instance associated to
    entry object
    (entry-parent): new generic function; return parent entry of an entry
    (entry-children): new generic function; return child entries of an
    entry
  • src/introspection/mixins.lisp (change-hook-mixin): new class; can be
    mixed into database classes to provide a change hook
    (database-change-hook): new method; return database change hook
  • src/introspection/remote-introspection.lisp: new file; contains remote
    introspection implementation with `introspection-receiver',
    `{participant,process,host}-entry', `remote-introspection-database'
    and `remote-introspection' classes
  • src/introspection/package.lisp (package rsb.introspection): added
    imported-from rsb.patterns.request-reply symbols remote-call-error,
    future-done? future-result, server-method and call; added exported
    symbols database-change-hook, introspection-survey,
    introspection-ping, entry-info, participant-entry, entry-parent,
    entry-children, process-entry and host-entry
  • test/introspection/remote-introspection.lisp: new file; unit tests for
    remote introspection functionality
  • test/introspection/package.lisp (package rsb.introspection.test):
    added imported-from rsb.introspection symbol
    remote-introspection-database
  • rsb-introspection.asd (system rsb-introspection): added file
    src/introspection/remote-introspection.lisp
    (system rsb-introspection-test): added file
    test/introspection/remote-introspection.lisp

History

#1 Updated by J. Moringen over 9 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 60 to 100

Also available in: Atom PDF