Created
August 18, 2020 09:01
-
-
Save ashhadulislam/d36f401ddb8b39f098a81801abece3d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from boto import kinesis | |
import sys | |
from random import seed | |
from random import randint | |
import time | |
import random | |
kinesis = kinesis.connect_to_region("us-east-2") | |
print(kinesis.list_streams()) | |
seed(1) | |
i=0 | |
while 1==1: | |
new_dict={} | |
new_dict["timestamp"]=int(time.time()) | |
new_dict["dataNum"]="data"+str(i) | |
new_dict["device_name"]="dev" | |
new_dict["HeartRate"]=random.randint(60, 120) | |
print("loading ",json.dumps(new_dict)) | |
kinesis.put_record("end-stream", json.dumps(new_dict), "partitionkey") | |
time.sleep(0.2) | |
i+=1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment