Skip to content

Commit bc51558

Browse files
authored
Merge pull request #12 from aiven/adding_timestamp
Adding timestamp
2 parents 00b23fa + 0e0b4a5 commit bc51558

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pizzaproducer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import random
2+
import time
23
from faker.providers import BaseProvider
34

45
# Adding a PizzaProvider with 3 methods:
@@ -69,7 +70,8 @@ def produce_msg (self, FakerInstance, ordercount = 1, max_pizzas_in_order = 5, m
6970
'name': FakerInstance.unique.name(),
7071
'phoneNumber': FakerInstance.unique.phone_number(),
7172
'address': FakerInstance.address(),
72-
'pizzas': pizzas
73+
'pizzas': pizzas,
74+
'timestamp': int(time.time()*1000)
7375
}
7476
key = {'shop': shop}
7577
return message, key

userbets.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import random
2+
import time
23
from faker.providers import BaseProvider
34

45
MIN_AMOUNT = 2 # Min betting amount
@@ -58,7 +59,8 @@ def produce_msg (self):
5859
'subcategory': bet_event['subcategory'],
5960
'name': bet_event['event']
6061
},
61-
'amount': bet_amount
62+
'amount': bet_amount,
63+
'timestap': int(time.time()*1000)
6264
}
6365
key = {'event': bet_event['event']}
6466
return message, key

0 commit comments

Comments
 (0)