Settings
Plugin configuration management via QgsSettings.
Contains the Settings enum whose members define all profiler plugin
settings with defaults, descriptions, and widget metadata for the settings dialog.
- class qgis_profiler.settings.WidgetType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
EnumRepresent the type of widget used for a setting in the UI.
- LINE_EDIT = 'line_edit'
- CHECKBOX = 'checkbox'
- SPIN_BOX = 'spin_box'
- class qgis_profiler.settings.SettingCategory(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
EnumCategorize settings for the settings dialog.
- GENERAL = 'General'
- PROFILER_GROUPS = 'Profiler Groups'
- CPROFILER = 'cProfiler'
- RECOVERY_METER = 'Recovery Meter'
- THREAD_HEALTH_CHECKER_METER = 'Thread Health Meter'
- MAP_RENDERING_METER = 'Map Rendering Meter'
- class qgis_profiler.settings.WidgetConfig(minimum=None, maximum=None, step=None)[source]
Bases:
objectConfiguration options for different widget types.
- Parameters:
minimum (int | float | None)
maximum (int | float | None)
step (int | float | None)
- minimum: int | float | None = None
- maximum: int | float | None = None
- step: int | float | None = None
- class qgis_profiler.settings.Setting(description, default, category=SettingCategory.GENERAL, widget_config=None, widget_type=None)[source]
Bases:
_QObjectStubDefine a single setting with default, category, and widget metadata.
- Parameters:
description (str)
default (Any)
category (SettingCategory)
widget_config (WidgetConfig | None)
widget_type (WidgetType | None)
- description: str
- default: Any
- category: SettingCategory = 'General'
- widget_config: WidgetConfig | None = None
- widget_type: WidgetType | None = None
- changed = <_qgis_stubs._StubSignal object>
- class qgis_profiler.settings.Settings(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
EnumManage profiler plugin configuration via QgsSettings.
Use get and set methods to interact with the settings. Provide a structured way to access and manage profiler-related settings.
- profiler_enabled = Setting(description='Enable profiling', default=True, category=<SettingCategory.GENERAL: 'General'>, widget_config=None, widget_type=<WidgetType.CHECKBOX: 'checkbox'>)
- show_events_threshold = Setting(description='Hide events shorter than this (seconds)', default=0.01, category=<SettingCategory.GENERAL: 'General'>, widget_config=WidgetConfig(minimum=0, maximum=100, step=0.1), widget_type=<WidgetType.SPIN_BOX: 'spin_box'>)
- start_recording_on_startup = Setting(description='Automatically start recording when QGIS launches', default=False, category=<SettingCategory.GENERAL: 'General'>, widget_config=None, widget_type=<WidgetType.CHECKBOX: 'checkbox'>)
- active_group = Setting(description='Group name for plugin profiling results', default='Profiler', category=<SettingCategory.PROFILER_GROUPS: 'Profiler Groups'>, widget_config=None, widget_type=<WidgetType.LINE_EDIT: 'line_edit'>)
- recorded_group = Setting(description='Group name for recorded event results', default='Profiler', category=<SettingCategory.PROFILER_GROUPS: 'Profiler Groups'>, widget_config=None, widget_type=<WidgetType.LINE_EDIT: 'line_edit'>)
- meters_group = Setting(description='Group name for meter measurement results', default='Profiler', category=<SettingCategory.PROFILER_GROUPS: 'Profiler Groups'>, widget_config=None, widget_type=<WidgetType.LINE_EDIT: 'line_edit'>)
- cprofiler_profile_path = Setting(description='File path for saving cProfile reports', default='/tmp/profiler', category=<SettingCategory.CPROFILER: 'cProfiler'>, widget_config=None, widget_type=<WidgetType.LINE_EDIT: 'line_edit'>)
- cprofiler_log_line_count = Setting(description='Maximum number of lines in cProfile report', default=100, category=<SettingCategory.CPROFILER: 'cProfiler'>, widget_config=WidgetConfig(minimum=0, maximum=100, step=1), widget_type=<WidgetType.SPIN_BOX: 'spin_box'>)
- recovery_meter_enabled = Setting(description='Enable recovery meter', default=False, category=<SettingCategory.RECOVERY_METER: 'Recovery Meter'>, widget_config=None, widget_type=<WidgetType.CHECKBOX: 'checkbox'>)
- recovery_threshold = Setting(description='Expected recovery time (seconds)', default=0.8, category=<SettingCategory.RECOVERY_METER: 'Recovery Meter'>, widget_config=WidgetConfig(minimum=0.0, maximum=100.0, step=0.1), widget_type=<WidgetType.SPIN_BOX: 'spin_box'>)
- recovery_timeout = Setting(description='Timeout before giving up (seconds)', default=10, category=<SettingCategory.RECOVERY_METER: 'Recovery Meter'>, widget_config=WidgetConfig(minimum=0, maximum=100, step=1), widget_type=<WidgetType.SPIN_BOX: 'spin_box'>)
- recovery_process_event_count = Setting(description='Number of events to process per measurement', default=100000, category=<SettingCategory.RECOVERY_METER: 'Recovery Meter'>, widget_config=WidgetConfig(minimum=1, maximum=1000000, step=10), widget_type=<WidgetType.SPIN_BOX: 'spin_box'>)
- thread_health_checker_enabled = Setting(description='Enable thread health checker', default=False, category=<SettingCategory.THREAD_HEALTH_CHECKER_METER: 'Thread Health Meter'>, widget_config=None, widget_type=<WidgetType.CHECKBOX: 'checkbox'>)
- thread_health_checker_poll_interval = Setting(description='Time between health checks (seconds)', default=1.0, category=<SettingCategory.THREAD_HEALTH_CHECKER_METER: 'Thread Health Meter'>, widget_config=WidgetConfig(minimum=0, maximum=100, step=0.1), widget_type=<WidgetType.SPIN_BOX: 'spin_box'>)
- thread_health_checker_threshold = Setting(description='Expected main thread response time (seconds)', default=0.1, category=<SettingCategory.THREAD_HEALTH_CHECKER_METER: 'Thread Health Meter'>, widget_config=WidgetConfig(minimum=0.001, maximum=100.0, step=0.001), widget_type=<WidgetType.SPIN_BOX: 'spin_box'>)
- map_rendering_meter_enabled = Setting(description='Enable map rendering meter', default=False, category=<SettingCategory.MAP_RENDERING_METER: 'Map Rendering Meter'>, widget_config=None, widget_type=<WidgetType.CHECKBOX: 'checkbox'>)
- map_rendering_meter_threshold = Setting(description='Expected map render time (seconds)', default=1.0, category=<SettingCategory.MAP_RENDERING_METER: 'Map Rendering Meter'>, widget_config=WidgetConfig(minimum=0, maximum=100, step=0.1), widget_type=<WidgetType.SPIN_BOX: 'spin_box'>)