Skip to content

Latest commit

 

History

History
244 lines (156 loc) · 14.7 KB

README.md

File metadata and controls

244 lines (156 loc) · 14.7 KB

observation-deck

Deployed here

This page hosts a catalogue of widgets for visualising libp2p introspection data, built on the libp2p observer-toolkit.

Usage

1. Connecting to libp2p Introspection data

1.1 Try it out without your own data

To simply explore what the libp2p Observation Deck has to offer, visit the deployed page and select "Samples", then choose one of the pre-made sample files. This allows you explore the libp2p Observation Deck catalogue and try out widgets using mock libp2p data samples.

1.2 Connect to a libp2p Introspection node

First, run libp2p using the Introspection module, and get the port number and URI of the libp2p Introspection endpoint. In the libp2p Observation Deck UI, open "Live Connection" and enter this as a websocket URL: for example, if the introspection module endpoint is introspect on port 12345, enter ws://localhost:12345/introspect.

If this works, a "loading" message should display and then the page will navigate to the libp2p Observation Deck catalogue.

1.3 Upload a file

The libp2p Observation Deck uses the libp2p Observer Shell which can export libp2p Introspection data as a binary file.

If you have such a file, you can import it using the "Upload a file" option, by either dragging the file into the opened "Upload a file" button or clicking again to use your operating system's usual file browser.

2. Choosing a widget

After selecting a data source, the libp2p Observation Deck catalogue is shown. This displays all widgets currently approved for inclusion. Each displays a screenshot and a short description.

Click on one to open it and use it to visualize the currently loaded libp2p Introspection data.

2.1 Closing a widget

To close a widget and return to the catalogue, click the close "x" icon in the top right of the widget's header.

2.2 Using widget data filters

Most widgets have optional data filters. These can be set and unset by opening the "active filters" button on the right of the widget's header. While any widget-level filters are active, this button is highlighted and displays the number of currently active filters.

Unlike the "global" data filters set in the control panel, these filters only apply within the scope of the current widget and do not affect the data shown in the timeline or data exported using the Export data button. Their usage is the same in other ways, including having options to both disable and reset the filters.

2.3 About the current widget

The same widget description shown in the catalogue view may be accessed for the currently selected widget by opening the "About" button on the left side of the widget's header.

3. Using the timeline

When data is available, the main part of the control panel along the bottom of the screen is an interactive timeline. Each libp2p Introspection data set includes a series of "state" messages giving metrics of libp2p subsystems at a moment in time, and the timeline allows users to scroll back through these state messages to inspect a particular moment.

To help the user spot interesting activity, an area chart visualisation of data traffic inbound and outbound data traffic is shown.

3.1 Selecting a point in time

Clicking anywhere on the timeline selects that point in time. The magenta bar indicating the selected state jumps, and the area coverred by the bar indicates the selected time span, giving an indication of the resolution of the temporal resolution of the selected data as well as its position.

The bar may also be dragged, which will update visualisations as the bar moves, and may be nudged one message forward or backward using the keyboard left and right arrow keys.

Data after the currently selected time point is shaded to indicate that it is excluded from any visualisation in the currently selected widget.

3.2 Resetting to the latest point in time

When a point in time other than the latest is selected, an "x" icon is shown next to the current time label. Clicking this resets the timeline to the latest state message, allowing all available data to be included in the currently selected widget.

3.3 Showing incoming live data

By default, as new data is received by a live websocket connection, it is immediately shown and the timeline bar stays at the rightmost point in the timeline.

When a point earlier than the latest has been selected, this selection persists and new data is appended to the timeline after the current selection, not updating the current widget.

Clicking the "x" to reset the timeline reverts to the default behaviour and resumes live updates of the widget.

3.4 Pausing live data

When the data source is a websocket connection, the icon on the left of the control panel indicating the data source acts as a "play/pause" button. Clicking on it sends a "pause" or "start" signal to the libp2p Introspection server, instructing the server to queue new data instead of sending it.

Note that because the libp2p Introspection server may have already dispatched or queued messages, there may be a small amount of data received after "pausing".

3.5 Timeline traffic visualisation

To guide users towards interesting points in a libp2p Introspection data set, the timeline displays a visualisation of traffic over time. The yellow upper area indicates how much new inbound data was receieved during a time interval, and the blue lower area indicates how much outbound data was sent out during that time interval. Bands on these areas indicate particular connections.

Mouseover of a particular band in this visualisation highlights that connection's inbound and outbound data activity across the timeline. These user selections are shared with widgets allowing widgets to highlight items with the same Peer ID as the highlighted connections.

4. Changing a data source

The current data source may be changed at any time by clicking the topmost button in the left side of the control panel. This opens the same interface for choosing a data source as on the home page: see section 1.1 for details.

5. Global data filters

Filters may be applied to centrally held data by clicking the "filter" button on the left side of the control panel. Any data removed by these filters is removed from every widget, from the timeline, and also excluded from data file exports.

When connected to a live websocket, filters are applied to all new incoming data as well as old data stored in memory.

5.1 Active filters

While filters are active, this button is highlighted and indicates the number of currently active filters.

5.2 Disabling filters

When selections have been made for a filter, a checkbox is shown to the left of the filter name allowing users to disable the filter without clearing the current selection. This can be useful for quickly toggling a filter on and off to see what data changes.

5.3 Reseting filters

Filter controls can be reset, clearing all selections to the default state, using the "x" icon to the right of the filter name.

6. Exporting data

The current loaded data, after applying global filters, may be exported as a binary file that can be loaded into the libp2p Observation Deck (or other tools built on libp2p Observer Catalogue). The file format used for these files is described in the libp2p Observer file format docs, and matches the format of binary sent and recieved over websockets.

Clicking the Export Button prepares data for export and displays the current file size of the binary to be exported. Clicking this button downloads this binary file, with a datestamped filename.

7. Peer Ids

The Peer Id of the libp2p node acting as data source is displayed in the control panel for reference. It is displayed as a "PeerId Avatar" from the libp2p Observer SDK, and this same presentation may be used in widgets.

7.1. Peer Id avatar image

Each Peer ID displayed using this avatar format shows an automatically-generated hexagonal image with coloured segments. These colours are generated from the hash of the full Peer ID, and will be the same any time this Peer ID appears. In visualisations that include many Peer IDs, this may help users to spot frequently-appearing Peer Ids and help users follow peer ids that move as data changes.

7.2. Peer Id snippet

The last 5 characters of the Peer ID are shown. This can help users locate occurences of a particular Peer ID using tools such as "find".

7.3. Full Peer ID in tooltip

On mouseover of a Peer ID avatar, the full Peer ID string is shown, along with a button that immediately copies the full Peer ID to the clipboard.

7.4. Info and Settings

The last button in the left side of the control panel opens a window that displays information about the libp2p node providing the data, its environment, and the settings of the libp2p Introspection server.

7.4.1. Implementation

This refers to the implementation of the P2P engine being used. For example, an entry go-libp2p indicates that the data is coming from a node using go-libp2p, the golang implementation of libp2p.

7.4.2. Version

This gives the version number of the P2P implementation described above.

7.4.3. Platform

This gives the operating system on which the given P2P implemenation is running.

7.4.4. "State messages every:"

This indicates the frequency at which state messages are being generated by the libp2p Introspection server, and therefore indicates the granularity of data on the timeline.

On live websocket connections, this is edittable: a new interval duration may be set and a signal will be sent to the libp2p Introspection server to start generating and sending state messages at this new frequency.

7.4.5. "Discard data after:"

This indicates the maximum amount of time old messages will be kept for before being discarded to potentially free memory.

On live websocket connections, this is edittable: a new cutoff time may be set and a signal will be sent to the libp2p Introspection server allowing it to update its settings, and the app's own datastore will start discarding data older than this given time.

If memory issues are found using the libp2p Observation Deck on a system with limited memory or in a context where a very large amount of data is being sent, lowering this setting may improve performance.

Contribute a widget

This project is open to community-created widgets, and will include high quality, useful widgets that have been approved by the core team.

To contribute a widget: