forked from platformio/platformio-core
Ignore idedata event
This commit is contained in:
@ -16,6 +16,7 @@ import atexit
|
|||||||
import platform
|
import platform
|
||||||
import Queue
|
import Queue
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
import threading
|
import threading
|
||||||
from collections import deque
|
from collections import deque
|
||||||
from os import getenv, sep
|
from os import getenv, sep
|
||||||
@ -152,16 +153,21 @@ class MeasurementProtocol(TelemetryBase):
|
|||||||
cmd_path.append(sub_cmd)
|
cmd_path.append(sub_cmd)
|
||||||
self['screen_name'] = " ".join([p.title() for p in cmd_path])
|
self['screen_name'] = " ".join([p.title() for p in cmd_path])
|
||||||
|
|
||||||
def send(self, hittype):
|
def _ignore_hit(self):
|
||||||
if not app.get_setting("enable_telemetry"):
|
if not app.get_setting("enable_telemetry"):
|
||||||
|
return True
|
||||||
|
if app.get_session_var("caller_id") and \
|
||||||
|
all(c in sys.argv for c in ("run", "idedata")):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
def send(self, hittype):
|
||||||
|
if self._ignore_hit():
|
||||||
return
|
return
|
||||||
|
|
||||||
self['t'] = hittype
|
self['t'] = hittype
|
||||||
|
|
||||||
# correct queue time
|
# correct queue time
|
||||||
if "qt" in self._params and isinstance(self['qt'], float):
|
if "qt" in self._params and isinstance(self['qt'], float):
|
||||||
self['qt'] = int((time() - self['qt']) * 1000)
|
self['qt'] = int((time() - self['qt']) * 1000)
|
||||||
|
|
||||||
MPDataPusher().push(self._params)
|
MPDataPusher().push(self._params)
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user