summaryrefslogtreecommitdiff
path: root/dynamic
diff options
context:
space:
mode:
Diffstat (limited to 'dynamic')
-rw-r--r--dynamic/__init__.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/dynamic/__init__.py b/dynamic/__init__.py
index fdcde57..b77dd22 100644
--- a/dynamic/__init__.py
+++ b/dynamic/__init__.py
@@ -57,6 +57,13 @@ def following_pairs_patterns(trace_data):
for v1, v2 in zip(val, val[1:]):
yield "[{}]:[{}]".format(v1[2], v2[2])
+def single_value_patterns(trace_data):
+ series = trace_data['series']
+ for se, val in series.items():
+ for v in val:
+ yield "value: {}".format(v[2])
+
+
def get_trace_data(code, call=None, inputs=None):
if call:
code += '\n\n' + call
@@ -70,6 +77,8 @@ def get_attributes(programs, call, inputs):
trace = get_trace_data(program, call, inputs)
for pat in following_pairs_patterns(trace):
patterns[pat] += [program]
+ for pat in single_value_patterns(trace):
+ patterns[pat] += [program]
attrs = collections.OrderedDict()
for pat, progs in sorted(patterns.items(), key=lambda x: len(x[1]), reverse=True):