# 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
        if r_len < self.RESERVOIR_SIZE:
            self.reservoir.append(value)
        else:
            self.reservoir[random.randint(0, self.RESERVOIR_SIZE - 1)] = value

        self.num_samples += 1


    def evaluate_p95(self):
        if self.reservoir != None and len(self.reservoir) > 0:
            self.reservoir.sort()
            index = int(len(self.reservoir) / 100 * 95)
            self.measurement = self.reservoir[index]

            self.reservoir = self.reservoir[:0]

        for name, child in self.children.items():
            child.evaluate_p95()


    def evaluate_percent(self, total_samples):
        self.measurement = (self.num_samples / total_samples) * 100

        for name, child in self.children.items():
            child.evaluate_percent(total_samples)


    def convert_to_percent(self, total):
        self.measurement = (self.measurement / total) * 100


# 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

        if r_len < self.RESERVOIR_SIZE:
            self.reservoir.append(value)
        else:
            self.reservoir[random.randint(0, self.RESERVOIR_SIZE - 1)] = value

        self.num_samples += 1


    def evaluate_p95(self):
        if self.reservoir != None and len(self.reservoir) > 0:
            self.reservoir.sort()
            index = int(len(self.reservoir) / 100 * 95)
            self.measurement = self.reservoir[index]

            self.reservoir = self.reservoir[:0]

        for name, child in self.children.items():
            child.evaluate_p95()


    def evaluate_percent(self, total_samples):
        self.measurement = (self.num_samples / total_samples) * 100

        for name, child in self.children.items():
            child.evaluate_percent(total_samples)


    def convert_to_percent(self, total):
        self.measurement = (self.measurement / total) * 100


        for name, child in self.children.items():