def __init__(self): self.request_id = "req-" + str(uuid4()) self.start_time = dt.datetime.utcnow() self.end_time = None self.active_spans = [] self.complete_spans = [] self.tags = {} self.is_real_request = False self._memory_start = get_rss_in_mb() self.callset = NPlusOneCallSet() logger.debug("Starting request: %s", self.request_id)
def __init__(self): self.request_id = "req-" + str(uuid4()) self.start_time = dt.datetime.utcnow() self.end_time = None self.active_spans = [] self.complete_spans = [] self.tags = {} self.is_real_request = False self._memory_start = get_rss_in_mb() self.n_plus_one_tracker = NPlusOneTracker() self.hit_max = False self.sent = False logger.debug("Starting request: %s", self.request_id)
def _get_mem_delta(self): current_mem = get_rss_in_mb() if current_mem > self._memory_start: return current_mem - self._memory_start return 0.0