# Path: stackimpact/utils.py
# def timestamp():
#     return int(time.time())
# 
# def generate_uuid():
#     return str(uuid.uuid4())
# 
# def generate_sha1(text):
#     sha1_hash = hashlib.sha1()
#     sha1_hash.update(text.encode('utf-8'))
#     return sha1_hash.hexdigest()


import threading
import random
import math
from .utils import timestamp, generate_uuid, generate_sha1
        for name, child in self.children.items():
            child_depth = child.depth()
            if child_depth > max_depth:
                max_depth = child_depth

        return max_depth + 1


    def propagate(self):
        for name, child in self.children.items():
            child.propagate()
            self.measurement += child.measurement
            self.num_samples += child.num_samples


    def increment(self, value, count):
        self.measurement += value
        self.num_samples += count


    def update_p95(self, value):
        r_len = 0
        r_exists = True

        if self.reservoir == None:
            r_exists = False
        else:
            r_len = len(self.reservoir)

        if not r_exists:

# Path: stackimpact/utils.py
# def timestamp():
#     return int(time.time())
# 
# def generate_uuid():
#     return str(uuid.uuid4())
# 
# def generate_sha1(text):
#     sha1_hash = hashlib.sha1()
#     sha1_hash.update(text.encode('utf-8'))
#     return sha1_hash.hexdigest()


# Path: stackimpact/metric.py
import threading
import random
import math
from .utils import timestamp, generate_uuid, generate_sha1

        for name, child in self.children.items():
            child_depth = child.depth()
            if child_depth > max_depth:
                max_depth = child_depth

        return max_depth + 1


    def propagate(self):
        for name, child in self.children.items():
            child.propagate()
            self.measurement += child.measurement
            self.num_samples += child.num_samples


    def increment(self, value, count):
        self.measurement += value
        self.num_samples += count


    def update_p95(self, value):
        r_len = 0
        r_exists = True

        if self.reservoir == None:
            r_exists = False
        else:
            r_len = len(self.reservoir)

        if not r_exists:

            self.reservoir = []