python decorator函数跟踪函数调用的运行时统计信息
runtime-stats的Python项目详细描述
#函数的运行时统计信息
python decorator函数的运行时统计信息跟踪函数调用的运行时统计信息跟踪函数调用的运行时统计信息跟踪函数调用的运行时统计信息
例如
`` `
@runtime_stats()
def self mult(n):
sleep(0.2)
returnn*n
prin(self mult(10));<100
prin(self mult(7))<49
49
打印(self mult.get func(self mult.get func)打印(self func)打印(self mult._runtime_stats())35;=>;{总时间':401.668,'平均':200.834,'函数uid':4302206808,'函数名':'自乘','最小':200.445,'最大':201.223,'总调用':2}
`````
总时间)
python decorator函数的运行时统计信息跟踪函数调用的运行时统计信息跟踪函数调用的运行时统计信息跟踪函数调用的运行时统计信息
例如
`` `
@runtime_stats()
def self mult(n):
sleep(0.2)
returnn*n
prin(self mult(10));<100
prin(self mult(7))<49
49
打印(self mult.get func(self mult.get func)打印(self func)打印(self mult._runtime_stats())35;=>;{总时间':401.668,'平均':200.834,'函数uid':4302206808,'函数名':'自乘','最小':200.445,'最大':201.223,'总调用':2}
`````
总时间)