Created
May 20, 2019 16:07
-
-
Save Morendil/134544a4e11a06f345aa780649c03e7b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Frame: | |
def __init__(self, tracer): | |
self.tracer = tracer | |
def __enter__(self): | |
set things up | |
return thing | |
def __exit__(self, type, value, traceback): | |
self.tracer.pop() | |
class StackTracer | |
def frame(): | |
return Frame(self): | |
def record_value(array): | |
pass | |
def record_start(time): | |
pass | |
def pop(): | |
self.stack.pop() | |
class FullTracer | |
def __init__() | |
self.current_frame = None | |
def frame(): | |
new_child = Frame(self) | |
return new_child: | |
def record_value(array): | |
self.current_frame.value = array | |
def record_start(time): | |
self.current_frame['start'] = time | |
def pop(): | |
???? | |
self.children.add() | |
FullTracer: | |
{ | |
name:"salaire_imposable", | |
period:"2017", | |
start:200, | |
end:250, | |
free_memory_start:???, | |
free_memory_end:???, | |
status:'calc','cache','input', | |
children:[ | |
{ | |
name:"salaire_net", | |
period:"2017", | |
start:201, | |
end:250, | |
}, | |
{ | |
name:"param.toto", | |
period:"2017", | |
start:201, | |
end:250, | |
}, | |
{ | |
name:"csg", | |
etc. | |
} | |
] | |
} | |
=> | |
{ | |
name:"salaire_imposable", | |
period:"2017", | |
value:50 (timing) | |
children:[ | |
{ | |
name:"salaire_net", | |
etc. | |
}, | |
{ | |
name:"csg", | |
etc. | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment