Monitor a set of parameters in a background thread stream output over websocket

To start monitor, run this file, or if qcodes is installed as a module:

% python -m qcodes.monitor.monitor

Add parameters to monitor in your measurement by creating a new monitor with a list of parameters to monitor:

monitor = qcodes.Monitor(param1, param2, param3, ...)

class qcodes.monitor.monitor.Monitor(*parameters: qcodes.instrument.parameter.Parameter, interval: float = 1)[source]

Bases: threading.Thread

QCodes Monitor - WebSockets server to monitor qcodes parameters.

Monitor qcodes parameters.

  • *parameters – Parameters to monitor.

  • interval – How often one wants to refresh the values.

running = None
run() None[source]

Start the event loop and run forever.

update_all() None[source]

Update all parameters in the monitor.

stop() None[source]

Shutdown the server, close the event loop and join the thread. Setting active Monitor to None.

join(timeout: Optional[float] = None) None[source]

Overwrite Thread.join to make sure server is stopped before joining avoiding a potential deadlock.

static show() None[source]

Overwrite this method to show/raise your monitor GUI F.ex.

import webbrowser
url = "localhost:3000"
# Open URL in new window, raising the window if possible.
property daemon

A boolean value indicating whether this thread is a daemon thread.

This must be set before start() is called, otherwise RuntimeError is raised. Its initial value is inherited from the creating thread; the main thread is not a daemon thread and therefore all threads created in the main thread default to daemon = False.

The entire Python program exits when only daemon threads are left.

property ident

Thread identifier of this thread or None if it has not been started.

This is a nonzero integer. See the get_ident() function. Thread identifiers may be recycled when a thread exits and another thread is created. The identifier is available even after the thread has exited.


Return whether the thread is alive.

This method is deprecated, use is_alive() instead.


Return whether the thread is alive.

This method returns True just before the run() method starts until just after the run() method terminates. The module function enumerate() returns a list of all alive threads.

property name

A string used for identification purposes only.

It has no semantics. Multiple threads may be given the same name. The initial name is set by the constructor.


Start the thread’s activity.

It must be called at most once per thread object. It arranges for the object’s run() method to be invoked in a separate thread of control.

This method will raise a RuntimeError if called more than once on the same thread object.

qcodes.monitor.monitor.main() None[source]