forked from petrytar/mad_generator
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdata_structures.py
More file actions
35 lines (27 loc) · 924 Bytes
/
data_structures.py
File metadata and controls
35 lines (27 loc) · 924 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import random
import logging
import time
class Datastores:
def __init__(self):
self.datastores_count = 0
logging.debug("Datastores object created")
def getNewDatastore(self):
self.datastores_count = self.datastores_count + 1
datastore_info = {
"datastore_id": self.datastores_count,
"datastore": "datastore" + str(self.datastores_count),
}
return datastore_info
class Regtimes:
def __init__(self, first_time=time.time()):
self.first_time = first_time
self.last_time = None
def getTime(self):
if self.last_time:
return_time = self.last_time + random.randint(1, random.randint(50, 150))
self.last_time = return_time
return return_time
else:
return_time = round(self.first_time)
self.last_time = return_time
return return_time