mirror of
https://github.com/codex-storage/das-research.git
synced 2025-02-23 16:28:27 +00:00
duplicate data plot fixed
This commit is contained in:
parent
fe8cde9a61
commit
201fc08da0
@ -1035,11 +1035,12 @@ class Visualizor:
|
|||||||
|
|
||||||
def plotDupData(self, result, plotPath):
|
def plotDupData(self, result, plotPath):
|
||||||
"""Plots the percentage of nodes ready in the network"""
|
"""Plots the percentage of nodes ready in the network"""
|
||||||
vector1 = result.metrics["progress"]["Dup class1 mean"]
|
vectors = {}
|
||||||
vector2 = result.metrics["progress"]["Dup class2 mean"]
|
for nc in result.shape.nodeClasses:
|
||||||
for i in range(len(vector1)):
|
if nc != 0: vectors[nc] = result.metrics["progress"][f"Dup class{nc} mean"]
|
||||||
vector1[i] = (vector1[i] * 8 * (1000/self.config.stepDuration) * self.config.segmentSize) / 1000000
|
for _k in vectors.keys():
|
||||||
vector2[i] = (vector2[i] * 8 * (1000/self.config.stepDuration) * self.config.segmentSize) / 1000000
|
for i in range(len(list(vectors.values())[0])):
|
||||||
|
vectors[_k][i] = (vectors[_k][i] * 8 * (1000/self.config.stepDuration) * self.config.segmentSize) / 1000000
|
||||||
conf = {}
|
conf = {}
|
||||||
attrbs = self.__get_attrbs__(result)
|
attrbs = self.__get_attrbs__(result)
|
||||||
nodeTypes = self.__getNodeTypes__(attrbs['ntypes'])
|
nodeTypes = self.__getNodeTypes__(attrbs['ntypes'])
|
||||||
@ -1056,12 +1057,15 @@ class Visualizor:
|
|||||||
conf["type"] = "plot"
|
conf["type"] = "plot"
|
||||||
conf["legLoc"] = 2
|
conf["legLoc"] = 2
|
||||||
conf["desLoc"] = 2
|
conf["desLoc"] = 2
|
||||||
conf["colors"] = ["c-", "m-"]
|
# conf["colors"] = ["c-", "m-"]
|
||||||
conf["labels"] = ["Solo stakers", "Staking pools"]
|
conf["labels"] = []
|
||||||
|
conf["data"] = []
|
||||||
|
for _k, _v in vectors.items():
|
||||||
|
conf["labels"].append(f"Node Class: {_k}")
|
||||||
|
conf["data"].append(_v)
|
||||||
conf["xlabel"] = "Time (ms)"
|
conf["xlabel"] = "Time (ms)"
|
||||||
conf["ylabel"] = "Bandwidth (MBits/s)"
|
conf["ylabel"] = "Bandwidth (MBits/s)"
|
||||||
conf["data"] = [vector1, vector2]
|
conf["xdots"] = [x*self.config.stepDuration for x in range(len(list(vectors.values())[0]))]
|
||||||
conf["xdots"] = [x*self.config.stepDuration for x in range(len(vector1))]
|
|
||||||
conf["path"] = plotPath+"/dupData.png"
|
conf["path"] = plotPath+"/dupData.png"
|
||||||
maxi = 0
|
maxi = 0
|
||||||
for v in conf["data"]:
|
for v in conf["data"]:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user