@classmethod
def set_upload_enabled(cls, enabled: bool):
    "\n        Enable or disable Glean collection and upload.\n\n        Metric collection is enabled by default.\n\n        When uploading is disabled, metrics aren't recorded at all and no data\n        is uploaded.\n\n        When disabling, all pending metrics, events and queued pings are cleared.\n\n        When enabling, the core Glean metrics are recreated.\n\n        Args:\n            enabled (bool): When True, enable metric collection.\n        "
    if cls.is_initialized():
        original_enabled = cls.get_upload_enabled()

        @Dispatcher.launch
        def set_upload_enabled():
            _ffi.lib.glean_set_upload_enabled(enabled)
            if ((original_enabled is False) and (cls.get_upload_enabled() is True)):
                cls._initialize_core_metrics()
            if ((original_enabled is True) and (cls.get_upload_enabled() is False)):
                DeletionPingUploadWorker.process()
    else:
        cls._upload_enabled = enabled
Enable or disable Glean collection and upload.

Metric collection is enabled by default.

When uploading is disabled, metrics aren't recorded at all and no data
is uploaded.

When disabling, all pending metrics, events and queued pings are cleared.

When enabling, the core Glean metrics are recreated.

Args:
    enabled (bool): When True, enable metric collection.
@classmethod
def set_upload_enabled(cls, enabled: bool):
    "\n        Enable or disable Glean collection and upload.\n\n        Metric collection is enabled by default.\n\n        When uploading is disabled, metrics aren't recorded at all and no data\n        is uploaded.\n\n        When disabling, all pending metrics, events and queued pings are cleared.\n\n        When enabling, the core Glean metrics are recreated.\n\n        Args:\n            enabled (bool): When True, enable metric collection.\n        "
    if cls.is_initialized():
        original_enabled = cls.get_upload_enabled()

        @Dispatcher.launch
        def set_upload_enabled():
            _ffi.lib.glean_set_upload_enabled(enabled)
            if ((original_enabled is False) and (cls.get_upload_enabled() is True)):
                cls._initialize_core_metrics()
            if ((original_enabled is True) and (cls.get_upload_enabled() is False)):
                DeletionPingUploadWorker.process()
    else:
        cls._upload_enabled = enabled