mobile_insight.monitor.monitor module

An abstraction for mobile network monitor. All specific trace collectors (DM, RIL, pcap, Replayer, etc.) derive from it.

Author: Yuanjie Li

class mobile_insight.monitor.monitor.Monitor

Bases: mobile_insight.element.Element

An abstraction for mobile network monitors

available_log_types()

Return available log types

deregister(analyzer)

Deregister an analyzer driven by this monitor

Parameters

analyzer (Analyzer) – the analyzer to be removed

enable_log(type_name)

Enable the messages to be monitored.

Parameters

type_name (string or list) – the message type(s) to be monitored

enable_log_all()

Enable all supported logs

register(analyzer)

Register an analyzer driven by this monitor

Parameters

analyzer (Analyzer) – the analyzer to be added

run()

Start monitoring the mobile network. This is usually the entrance of monitoring and analysis.

This method should be overloaded in every subclass.

save_log_as(path)

Save the log as a mi2log file (for offline analysis)

Parameters
  • path (string) – the file name to be saved

  • log_types (list of string) – a filter of message types to be saved

set_sampling_rate(sampling_rate)

Set a target sampling rate for cross-layer sampling

Parameters

sampling_rate (an integer between 0 and 100) – the target sampling rate

set_skip_decoding(decoding)

Configure whether deferred message decoding is enabled

Parameters

decoding (Boolean) – if True, only the message header would be decoded, otherwise the entire packet would be decoded