Skip to content

Instantly share code, notes, and snippets.

@pilshchikov
Last active October 9, 2018 11:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pilshchikov/8aff4e30d83f8bac20c5a4a9c3917abb to your computer and use it in GitHub Desktop.
Save pilshchikov/8aff4e30d83f8bac20c5a4a9c3917abb to your computer and use it in GitHub Desktop.
Ignite Python thin client bench
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