Last active
October 9, 2018 11:45
-
-
Save pilshchikov/8aff4e30d83f8bac20c5a4a9c3917abb to your computer and use it in GitHub Desktop.
Ignite Python thin client bench
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
from pyignite import Client | |
from time import time | |
client = Client() | |
client.connect('[grid ip]', 10800) | |
cache = client.get_or_create_cache("python_bench_cache") | |
start_time = round(time()) | |
end_time = start_time + 120 | |
last_seeing_time = start_time | |
last_key = 0 | |
counter = 0 | |
while (round(time()) < end_time): | |
current_time = round(time()) | |
if last_seeing_time != current_time: | |
last_seeing_time = current_time | |
time_pass = current_time - start_time | |
print("time {} | counter {} | values count {}".format(time_pass, counter, last_key)) | |
counter = 0 | |
counter += 1 | |
last_key += 1 | |
cache.put(last_key, last_key * 2) | |
cache.destroy() | |
client.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment