本文整理汇总了Python中edge.Edge.setStats方法的典型用法代码示例。如果您正苦于以下问题:Python Edge.setStats方法的具体用法?Python Edge.setStats怎么用?Python Edge.setStats使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edge.Edge
的用法示例。
在下文中一共展示了Edge.setStats方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __addNode
# 需要导入模块: from edge import Edge [as 别名]
# 或者: from edge.Edge import setStats [as 别名]
def __addNode(self, current_time, nodeStatData):
# adding nodes
key = nodeStatData[0] #(file_path, ligne_number, method_name)
value = nodeStatData[1] #(count, countWithRecursive, exclusiveTime, cummulatedTime, callersData)
node = self.__searchNode(key)
count_data = StampedData(value[0], value[1], value[2], value[3])
if node is None:
node = Node(key[0], key[1], key[2], self.__program_folder, self.__program_path)
self.__nodes.append(node)
node.setStats(current_time, count_data)
# adding edges
callersData = value[4]
for c in callersData.items():
caller = c[0] # same structure as key: (file_path, ligne_number, method_name)
callerStats = c[1] # same structure as value (without callersData): (count, countWithRecursive, exclusiveTime, cummulatedTime)
count_data = StampedData(callerStats[0], callerStats[1], callerStats[2], callerStats[3])
callerNode = self.__searchNode(caller)
if callerNode is None:
callerNode = Node(caller[0], caller[1], caller[2], self.__program_folder, self.__program_path)
self.__nodes.append(callerNode)
edge = self.__searchEdge(callerNode.getId(), node.getId())
if edge is None:
edge = Edge(callerNode.getId(), node.getId())
self.__edges.append(edge)
edge.setStats(current_time, count_data)