In [1]:
%matplotlib inline
import os
import StringIO
import time
import numpy
import pandas
import seaborn
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
from qumulo.rest_client import RestClient
In [2]:
rc = RestClient("<qumulo-cluster>", 8000)
rc.login("<qumulo-user>", "<qumulo-password>");
In [23]:
parent_path = "/test"
dir_name = "test1"
file_count = 10000
print("This test takes ~1 minute to run.")
full_dir_path = parent_path + "/" + dir_name
rc.fs.create_directory(name="test1", dir_path="/test")
start_time = time.time()
for file_num in range(file_count):
rc.fs.create_file("f%s.txt" % file_num, dir_path = full_dir_path)
print("Created %s files in %s seconds" % (file_count, int(time.time() - start_time)))
rc.fs.delete_tree(full_dir_path)
last_rem = file_count
while last_rem > 0:
try:
d = rc.fs.tree_delete_status(full_dir_path)
cur_rem = int(d['remaining_files'])
print("Files remaining: %5s - deletes / second: %4s" % (cur_rem, last_rem - cur_rem))
last_rem = cur_rem
except:
break
time.sleep(1)
print("Done!")
In [ ]: