def create_event_id(self): i = str(self.event_id_count) self.event_id_count += 1 local_part = str(int(self.clock.time())) + i + random_string(5) e_id = EventID(local_part, self.hostname) return e_id.to_string()
def _create_event_id(clock, hostname): """Create a new event ID Args: clock (Clock) hostname (str): The server name for the event ID Returns: str """ global _event_id_counter i = str(_event_id_counter) _event_id_counter += 1 local_part = str(int(clock.time())) + i + random_string(5) e_id = EventID(local_part, hostname) return e_id.to_string()