Feature #1740

Feature #44: Implement basic introspection support

Implement introspection event sender

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

Status:ResolvedStart date:03/24/2014
Priority:NormalDue date:03/24/2014
Assignee:J. Moringen% Done:

100%

Category:Common Lisp
Target version:rsb-0.11

Description

  • Basic participant information
  • Echo server for clock measurements

Associated revisions

Revision 24059edd
Added by J. Moringen over 9 years ago

Added introspection? parameter to participant creation in src/**/*.lisp

refs #1740

  • src/protocol.lisp (make-participant): accept introspection? keyword
    parameter; adjusted documentation string accordingly
    (make-participant-using-class class t scope): accept introspection?
    keyword parameter; pass to make participant hook but not to next
    method
    (make-listener): added introspection? keyword parameter; adjusted
    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 server's introspection? option to created participant
    (server::introspection?): new slot; indicates whether introspection
    should be enabled for methods of the server
    (make-participant-using-class class server scope): accept
    introspection? keyword parameter; store value in created server
  • src/patterns/request-reply/local-server.lisp (set-method): pass local
    server's introspection? option 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 for :introspection? initarg
  • test/listener.lisp (define-basic-participant-test-cases listener):
    likewise
  • test/reader.lisp (define-basic-participant-test-cases reader):
    likewise
  • test/informer.lisp (define-basic-participant-test-cases informer):
    likewise
  • test/patterns/request-reply/local-server.lisp
    (define-basic-participant-test-cases local-server): likewise
  • test/patterns/request-reply/remote-server.lisp
    (define-basic-participant-test-cases remote-server): likewise

Revision dd56e082
Added by J. Moringen over 9 years ago

Initial introspection infrastructure in src/introspection/*.lisp

refs #1740, refs #1744

  • src/introspection/conditions.lisp: new file; contains conditions used
    by the introspection module
  • src/introspection/protocol.lisp: new file; contains protocol functions
    of the introspection module
  • src/introspection/variables.lisp: new file; contains functions for
    constructing introspection-related scopes and parameters holding
    default scopes
  • src/introspection/package.lisp: new file; package definition for
    introspection module
  • test/introspection/package.lisp: new file; package definition for unit
    tests of introspection module
  • rsb-introspection.asd: new file; system description for
    rsb-introspection system
  • lift-introspection.config: new file; lift configuration for testing
    the rsb-introspection system
  • CMakeLists.txt (test): new function; configure execution of unit tests
    of one (sub-)system; use to test cl-rsb and rsb-introspection as two
    separate systems

Revision 352375a0
Added by J. Moringen over 9 years ago

Support for gathering platform information in src/introspection/platform-*.lisp

refs #1740, refs #1823

New functions that use platform-specific mechanism to gain information
about the current process and local host.

  • src/introspection/platform-common.lisp: new file; contains common
    helper functions and non-platform-specific functions
  • src/introspection/platform-generic.lisp: new file; contains a generic
    fallback implementation of the platform information functions
  • src/introspection/platform-sbcl-linux.lisp: new file; contains an
    implementation of the platform information functions for SBCL on Linux
  • src/introspection/platform-sbcl-darwin.lisp: new file; contains an
    implementation of the platform information functions for SBCL on
    Darwin
  • src/introspection/platform-sbcl-win32.lisp: new file; contains an
    implementation of the platform information functions for SBCL on Win32
  • src/introspection/package.lisp (package rsb.introspection): added used
    packages let-plus and more-conditions
  • test/introspection/package.lisp (package rsb.introspection.test):
    added imported-from rsb.introspection symbols current-process-id,
    current-program-name-and-commandline-arguments,
    current-process-start-time and current-host-id
  • test/introspection/platform.lisp: new file; contains basic tests for
    platform information functionality
  • rsb-introspection.asd (system rsb-introspection): added system
    dependency on uiop; added files
    src/introspection/platform-{common,generic,sbcl-linux,sbcl-darwin,
    sbcl-win32}.lisp
    (system rsb-introspection-test): added file
    test/introspection/platform.lisp

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 8c1455bd
Added by J. Moringen over 9 years ago

Added converters for introspection messages in src/introspection/conversion.lisp

refs #1740, refs #1744

  • src/introspection/conversion.lisp: new file; contains converters
    between rsb.protocol.introspection.{Hello,Bye} protocol buffer
    messages and rsb.introspection:{hello,bye} classes
  • rsb-introspection.asd (system rsb-introspection): added file
    src/introspection/conversion.lisp

Revision 29ab7684
Added by J. Moringen over 9 years ago

Added introspection mixins in src/introspection/mixins.lisp

refs #1740, refs #1744

  • src/conditions (no-such-participant-error): new condition; signaled
    when a participant cannot be found in a container
  • src/introspection/protocol.lisp (introspection-participants): new
    generic function; return participants of a container
    (setf introspection-participants): new generic function; set
    participants of a container
    (introspection-participants/roots): new generic function; return root
    participants of a hierarchical container
    (call-with-database-lock): new generic function; call a thunk holding
    a database lock
  • src/introspection/mixins.lisp: new file; contains mixin classes used
    in the introspection module
  • src/introspection/package.lisp (package rsb.introspection): added
    exported symbols no-such-participant-error,
    no-such-participant-error-container, no-such-participant-error-id,
    introspection-participants, introspection-participants/roots,
    find-participant, call-with-database-lock and with-database-lock
  • rsb-introspection.asd (system rsb-introspection): added file
    src/introspection/mixins.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 22e5dc80
Added by J. Moringen over 9 years ago

Added dependency on rsb-introspection system in cl-rsb-tools-main.asd

refs #1740, refs #1751

This lets all tools publish introspection events and thus appear in
introspection reports.

  • cl-rsb-tools-main.asd (system cl-rsb-tools-main): added system
    dependency on rsb-introspection

History

#1 Updated by J. Moringen about 10 years ago

  • Description updated (diff)

#2 Updated by J. Moringen about 10 years ago

  • % Done changed from 50 to 80

#3 Updated by J. Moringen about 10 years ago

  • % Done changed from 80 to 90

#4 Updated by J. Moringen over 9 years ago

  • Category changed from Common Lisp to Introspection

#5 Updated by J. Moringen over 9 years ago

  • Category changed from Introspection to Common Lisp

#6 Updated by J. Moringen over 9 years ago

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

Also available in: Atom PDF