Classes | Functions | Variables
profile_analyzer Namespace Reference

Classes

class  CallStack
 
class  CallStackBuilder
 
class  LineItem
 
class  ScopeBuilder
 

Functions

def percentile (N, percent, key=lambda x:x)
 
def tidy_tag (tag)
 
def time_format (idx)
 
def time_string (values)
 

Variables

 _
 
int accounted_for = 0
 
 argp
 
 args = argp.parse_args()
 
dictionary BANNER = {'simple': 'Count: %(count)d', 'html': '<h1>Count: %(count)d</h1>'}
 
 builder = collections.defaultdict(CallStackBuilder)
 
 call_stacks = collections.defaultdict(CallStack)
 
 choices
 
 cs = builder[thd]
 
 default
 
list fields = []
 
list FORMAT
 
 header
 
 inf = json.loads(line)
 
int lines = 0
 
 out = sys.stdout
 
 SELF_TIME = object()
 
 start = time.time()
 
list table = []
 
 tabulate_formats
 
 thd = inf['thd']
 
 TIME_FROM_LAST_IMPORTANT = object()
 
 TIME_FROM_SCOPE_START = object()
 
 TIME_FROM_STACK_START = object()
 
 time_taken = time.time() - start
 
 TIME_TO_SCOPE_END = object()
 
 TIME_TO_STACK_END = object()
 
int total_stacks = 0
 
 type
 

Function Documentation

◆ percentile()

def profile_analyzer.percentile (   N,
  percent,
  key = lambda x: x 
)
Find the percentile of an already sorted list of values.

@parameter N - is a list of values. MUST be already sorted.
@parameter percent - a float value from [0.0,1.0].
@parameter key - optional key function to compute value from each element of N.

@return - the percentile of the values

Definition at line 187 of file profile_analyzer.py.

◆ tidy_tag()

def profile_analyzer.tidy_tag (   tag)

Definition at line 208 of file profile_analyzer.py.

◆ time_format()

def profile_analyzer.time_format (   idx)

Definition at line 220 of file profile_analyzer.py.

◆ time_string()

def profile_analyzer.time_string (   values)

Definition at line 214 of file profile_analyzer.py.

Variable Documentation

◆ _

profile_analyzer._
private

Definition at line 263 of file profile_analyzer.py.

◆ accounted_for

int profile_analyzer.accounted_for = 0

Definition at line 256 of file profile_analyzer.py.

◆ argp

profile_analyzer.argp
Initial value:
1 = argparse.ArgumentParser(
2  description='Process output of basic_prof builds')

Definition at line 34 of file profile_analyzer.py.

◆ args

profile_analyzer.args = argp.parse_args()

Definition at line 39 of file profile_analyzer.py.

◆ BANNER

dictionary profile_analyzer.BANNER = {'simple': 'Count: %(count)d', 'html': '<h1>Count: %(count)d</h1>'}

Definition at line 230 of file profile_analyzer.py.

◆ builder

profile_analyzer.builder = collections.defaultdict(CallStackBuilder)

Definition at line 159 of file profile_analyzer.py.

◆ call_stacks

profile_analyzer.call_stacks = collections.defaultdict(CallStack)

Definition at line 160 of file profile_analyzer.py.

◆ choices

profile_analyzer.choices

Definition at line 37 of file profile_analyzer.py.

◆ cs

profile_analyzer.cs = builder[thd]

Definition at line 169 of file profile_analyzer.py.

◆ default

profile_analyzer.default

Definition at line 36 of file profile_analyzer.py.

◆ fields

list profile_analyzer.fields = []

Definition at line 266 of file profile_analyzer.py.

◆ FORMAT

list profile_analyzer.FORMAT
Initial value:
1 = [
2  ('TAG', lambda line: '..' * line.indent + tidy_tag(line.tag)),
3  ('LOC', lambda line: '%s:%d' %
4  (line.filename[line.filename.rfind('/') + 1:], line.fileline)),
5  ('IMP', lambda line: '*' if line.important else ''),
6  ('FROM_IMP', time_format(TIME_FROM_LAST_IMPORTANT)),
7  ('FROM_STACK_START', time_format(TIME_FROM_STACK_START)),
8  ('SELF', time_format(SELF_TIME)),
9  ('TO_STACK_END', time_format(TIME_TO_STACK_END)),
10  ('FROM_SCOPE_START', time_format(TIME_FROM_SCOPE_START)),
11  ('SELF', time_format(SELF_TIME)),
12  ('TO_SCOPE_END', time_format(TIME_TO_SCOPE_END)),
13 ]

Definition at line 232 of file profile_analyzer.py.

◆ header

profile_analyzer.header

Definition at line 263 of file profile_analyzer.py.

◆ inf

profile_analyzer.inf = json.loads(line)

Definition at line 167 of file profile_analyzer.py.

◆ lines

int profile_analyzer.lines = 0

Definition at line 162 of file profile_analyzer.py.

◆ out

profile_analyzer.out = sys.stdout

Definition at line 246 of file profile_analyzer.py.

◆ SELF_TIME

profile_analyzer.SELF_TIME = object()

Definition at line 27 of file profile_analyzer.py.

◆ start

profile_analyzer.start = time.time()

Definition at line 163 of file profile_analyzer.py.

◆ table

list profile_analyzer.table = []

Definition at line 264 of file profile_analyzer.py.

◆ tabulate_formats

profile_analyzer.tabulate_formats

Definition at line 37 of file profile_analyzer.py.

◆ thd

profile_analyzer.thd = inf['thd']

Definition at line 168 of file profile_analyzer.py.

◆ TIME_FROM_LAST_IMPORTANT

profile_analyzer.TIME_FROM_LAST_IMPORTANT = object()

Definition at line 32 of file profile_analyzer.py.

◆ TIME_FROM_SCOPE_START

profile_analyzer.TIME_FROM_SCOPE_START = object()

Definition at line 28 of file profile_analyzer.py.

◆ TIME_FROM_STACK_START

profile_analyzer.TIME_FROM_STACK_START = object()

Definition at line 30 of file profile_analyzer.py.

◆ time_taken

profile_analyzer.time_taken = time.time() - start

Definition at line 176 of file profile_analyzer.py.

◆ TIME_TO_SCOPE_END

profile_analyzer.TIME_TO_SCOPE_END = object()

Definition at line 29 of file profile_analyzer.py.

◆ TIME_TO_STACK_END

profile_analyzer.TIME_TO_STACK_END = object()

Definition at line 31 of file profile_analyzer.py.

◆ total_stacks

int profile_analyzer.total_stacks = 0

Definition at line 181 of file profile_analyzer.py.

◆ type

profile_analyzer.type

Definition at line 36 of file profile_analyzer.py.

profile_analyzer.time_format
def time_format(idx)
Definition: profile_analyzer.py:220
profile_analyzer.tidy_tag
def tidy_tag(tag)
Definition: profile_analyzer.py:208


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:41