Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
S2-group
GitHub Repository: S2-group/android-runner
Path: blob/master/AndroidRunner/Plugins/Profiler.py
630 views
1
import logging
2
3
4
class Profiler(object):
5
6
# noinspection PyUnusedLocal
7
def __init__(self, config, paths):
8
self.logger = logging.getLogger(self.__class__.__name__)
9
pass
10
11
def dependencies(self):
12
"""Returns list of needed app dependencies,like com.quicinc.trepn, [] if none"""
13
raise NotImplementedError
14
15
def load(self, device):
16
"""Load (and start) the profiler process on the device"""
17
raise NotImplementedError
18
19
def start_profiling(self, device, **kwargs):
20
"""Start the profiling process"""
21
raise NotImplementedError
22
23
def stop_profiling(self, device, **kwargs):
24
"""Stop the profiling process"""
25
raise NotImplementedError
26
27
def collect_results(self, device):
28
"""Collect the data and clean up extra files on the device, save data in location set by 'set_output' """
29
raise NotImplementedError
30
31
def unload(self, device):
32
"""Stop the profiler, removing configuration files on device"""
33
raise NotImplementedError
34
35
def set_output(self, output_dir):
36
"""Set the output directory before the start_profiling is called"""
37
raise NotImplementedError
38
39
def aggregate_subject(self):
40
"""Aggregate the data at the end of a subject, collect data and save data to location set by 'set output' """
41
raise NotImplementedError
42
43
def aggregate_end(self, data_dir, output_file):
44
"""Aggregate the data at the end of the experiment.
45
Data located in file structure inside data_dir. Save aggregated data to output_file
46
"""
47
raise NotImplementedError
48
49
class ProfilerException(Exception):
50
pass
51
52