mirror of
https://github.com/logos-storage/das-research.git
synced 2026-01-05 22:53:07 +00:00
debug
This commit is contained in:
parent
3cdc53960c
commit
2a42c17a1f
10
DAS/node.py
10
DAS/node.py
@ -83,8 +83,8 @@ class Node:
|
|||||||
self.received_gossip = defaultdict(list)
|
self.received_gossip = defaultdict(list)
|
||||||
|
|
||||||
# query methods
|
# query methods
|
||||||
self.exponential_growth = False
|
self.exponential_growth = True
|
||||||
self.linear_growth = True
|
self.linear_growth = False
|
||||||
self.linear_constant_growth = False
|
self.linear_constant_growth = False
|
||||||
self.hybrid_growth = False
|
self.hybrid_growth = False
|
||||||
self.exponential_constant_growth = False
|
self.exponential_constant_growth = False
|
||||||
@ -92,10 +92,10 @@ class Node:
|
|||||||
|
|
||||||
# query results
|
# query results
|
||||||
self.query_times = []
|
self.query_times = []
|
||||||
self.query_total_time = 0
|
self.query_total_time = None
|
||||||
self.all_original_retries = []
|
self.all_original_retries = []
|
||||||
self.query_results = 'success'
|
self.query_results = None
|
||||||
self.original_retries_sum = 0
|
self.original_retries_sum = None
|
||||||
|
|
||||||
# Cache latency values based on horizon level
|
# Cache latency values based on horizon level
|
||||||
self.latency_cache = {
|
self.latency_cache = {
|
||||||
|
|||||||
@ -24,11 +24,11 @@ class Result:
|
|||||||
self.restoreColumnCount = [0] * shape.numberNodes
|
self.restoreColumnCount = [0] * shape.numberNodes
|
||||||
self.repairedSampleCount = [0] * shape.numberNodes
|
self.repairedSampleCount = [0] * shape.numberNodes
|
||||||
|
|
||||||
self.query_times = [[] for _ in range(shape.numberNodes)] # List of empty lists
|
self.query_times = [[] for _ in range(shape.numberNodes)]
|
||||||
self.query_total_time = [None] * shape.numberNodes # List of None values, or empty lists if needed
|
self.query_total_time = [None] * shape.numberNodes
|
||||||
self.all_original_retries = [[] for _ in range(shape.numberNodes)] # List of empty lists
|
self.all_original_retries = [[] for _ in range(shape.numberNodes)]
|
||||||
self.query_results = [''] * shape.numberNodes # List of empty strings
|
self.query_results = [''] * shape.numberNodes
|
||||||
self.original_retries_sum = [None] * shape.numberNodes # List of None values
|
self.original_retries_sum = [None] * shape.numberNodes
|
||||||
|
|
||||||
self.numberNodes = shape.numberNodes
|
self.numberNodes = shape.numberNodes
|
||||||
|
|
||||||
|
|||||||
@ -395,17 +395,28 @@ class Simulator:
|
|||||||
if not self.validators[i].amIaddedToQueue :
|
if not self.validators[i].amIaddedToQueue :
|
||||||
malicious_nodes_not_added_count += 1
|
malicious_nodes_not_added_count += 1
|
||||||
|
|
||||||
|
valid_rows = set()
|
||||||
|
valid_columns = set()
|
||||||
for i in range(0,self.shape.numberNodes):
|
for i in range(0,self.shape.numberNodes):
|
||||||
column_ids = []
|
column_ids = []
|
||||||
row_ids = []
|
row_ids = []
|
||||||
for rID in self.validators[i].rowIDs:
|
for rID in self.validators[i].rowIDs:
|
||||||
row_ids.append(rID)
|
row_ids.append(rID)
|
||||||
|
if not self.validators[i].amImalicious and not self.validators[i].amIproposer:
|
||||||
|
valid_rows.add(rID)
|
||||||
for cID in self.validators[i].columnIDs:
|
for cID in self.validators[i].columnIDs:
|
||||||
column_ids.append(cID)
|
column_ids.append(cID)
|
||||||
|
if not self.validators[i].amImalicious and not self.validators[i].amIproposer:
|
||||||
|
valid_columns.add(cID)
|
||||||
|
|
||||||
self.logger.debug("List of columnIDs for %d node: %s", i, column_ids, extra=self.format)
|
self.logger.debug("List of columnIDs for %d node: %s", i, column_ids, extra=self.format)
|
||||||
self.logger.debug("List of rowIDs for %d node: %s", i, row_ids, extra=self.format)
|
self.logger.debug("List of rowIDs for %d node: %s", i, row_ids, extra=self.format)
|
||||||
|
|
||||||
|
if len(valid_rows) >= self.shape.nbRowsK or len(valid_columns) >= self.shape.nbColsK:
|
||||||
|
self.logger.debug("Block available within the non-malicious nodes.", extra=self.format)
|
||||||
|
else:
|
||||||
|
self.logger.debug("Block not available within the non-malicious nodes.", extra=self.format)
|
||||||
|
|
||||||
self.logger.debug("Number of malicious nodes not added to the send queue: %d" % malicious_nodes_not_added_count, extra=self.format)
|
self.logger.debug("Number of malicious nodes not added to the send queue: %d" % malicious_nodes_not_added_count, extra=self.format)
|
||||||
malicious_nodes_not_added_percentage = (malicious_nodes_not_added_count * 100)/(self.shape.numberNodes)
|
malicious_nodes_not_added_percentage = (malicious_nodes_not_added_count * 100)/(self.shape.numberNodes)
|
||||||
self.logger.debug("Percentage of malicious nodes not added to the send queue: %d" % malicious_nodes_not_added_percentage, extra=self.format)
|
self.logger.debug("Percentage of malicious nodes not added to the send queue: %d" % malicious_nodes_not_added_percentage, extra=self.format)
|
||||||
|
|||||||
@ -205,7 +205,7 @@ class Visualizor:
|
|||||||
all_query_times = [time for time in result.query_total_time if time is not None]
|
all_query_times = [time for time in result.query_total_time if time is not None]
|
||||||
|
|
||||||
plt.boxplot(all_query_times, patch_artist=True, boxprops=dict(facecolor="lightblue"))
|
plt.boxplot(all_query_times, patch_artist=True, boxprops=dict(facecolor="lightblue"))
|
||||||
plt.title(f"Query Times", fontsize=16)
|
plt.title(f"Total Query Time for each node", fontsize=16)
|
||||||
plt.ylabel("Query Time (seconds)", fontsize=16)
|
plt.ylabel("Query Time (seconds)", fontsize=16)
|
||||||
plt.grid(True, axis='y', color='gray', linestyle='--', linewidth=0.5)
|
plt.grid(True, axis='y', color='gray', linestyle='--', linewidth=0.5)
|
||||||
plt.tick_params(axis='both', which='major', labelsize=16)
|
plt.tick_params(axis='both', which='major', labelsize=16)
|
||||||
|
|||||||
23
smallConf.py
23
smallConf.py
@ -154,6 +154,29 @@ colsK = range(32, 65, 128)
|
|||||||
rowsK = range(32, 65, 128)
|
rowsK = range(32, 65, 128)
|
||||||
|
|
||||||
def nextShape():
|
def nextShape():
|
||||||
|
params = {
|
||||||
|
"cols": cols,
|
||||||
|
"colsK": colsK,
|
||||||
|
"rows": rows,
|
||||||
|
"rowsK": rowsK,
|
||||||
|
"runs": runs,
|
||||||
|
"failureModels": failureModels,
|
||||||
|
"failureRates": failureRates,
|
||||||
|
"maliciousNodes": maliciousNodes,
|
||||||
|
"custodyRows": custodyRows,
|
||||||
|
"custodyCols": custodyCols,
|
||||||
|
"minCustodyRows": minCustodyRows,
|
||||||
|
"minCustodyCols": minCustodyCols,
|
||||||
|
"numberNodes": numberNodes,
|
||||||
|
"netDegrees": netDegrees,
|
||||||
|
"bwUplinksProd": bwUplinksProd,
|
||||||
|
"nodeTypesGroup": nodeTypesGroup,
|
||||||
|
}
|
||||||
|
for key, value in params.items():
|
||||||
|
if not value:
|
||||||
|
logging.warning(f"The parameter '{key}' is empty. Please assign a value and start the simulation.")
|
||||||
|
exit(1)
|
||||||
|
|
||||||
for nbCols, nbColsK, nbRows, nbRowsK, run, fm, fr, mn, chR, chC, minChR, minChC, nn, netDegree, bwUplinkProd, nodeTypes in itertools.product(
|
for nbCols, nbColsK, nbRows, nbRowsK, run, fm, fr, mn, chR, chC, minChR, minChC, nn, netDegree, bwUplinkProd, nodeTypes in itertools.product(
|
||||||
cols, colsK, rows, rowsK, runs, failureModels, failureRates, maliciousNodes, custodyRows, custodyCols, minCustodyRows, minCustodyCols, numberNodes, netDegrees, bwUplinksProd, nodeTypesGroup):
|
cols, colsK, rows, rowsK, runs, failureModels, failureRates, maliciousNodes, custodyRows, custodyCols, minCustodyRows, minCustodyCols, numberNodes, netDegrees, bwUplinksProd, nodeTypesGroup):
|
||||||
# Network Degree has to be an even number
|
# Network Degree has to be an even number
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user