Add script entrypoint that uses AutoProcessor

This commit is contained in:
Christophe Bedard 2019-12-31 13:53:30 -05:00
parent db9e94b1dc
commit 154ad1af7d
2 changed files with 26 additions and 0 deletions

View file

@ -43,6 +43,7 @@ setup(
'console_scripts': [ 'console_scripts': [
f'convert = {package_name}.convert:main', f'convert = {package_name}.convert:main',
f'process = {package_name}.process:main', f'process = {package_name}.process:main',
f'auto = {package_name}.scripts.auto:main',
f'cb_durations = {package_name}.scripts.cb_durations:main', f'cb_durations = {package_name}.scripts.cb_durations:main',
f'memory_usage = {package_name}.scripts.memory_usage:main', f'memory_usage = {package_name}.scripts.memory_usage:main',
], ],

View file

@ -0,0 +1,25 @@
# Copyright 2019 Apex.AI, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from tracetools_analysis.loading import load_file
from tracetools_analysis.processor import AutoProcessor
from . import get_input_path
def main():
input_path = get_input_path()
events = load_file(input_path)
processor = AutoProcessor(events)