Re-structure directories and modules

This commit is contained in:
Christophe Bedard 2019-07-29 14:44:41 +02:00
parent 4ccdbb688d
commit 2e37db5a79
10 changed files with 42 additions and 59 deletions

View file

@ -1,51 +0,0 @@
# Copyright 2019 Robert Bosch GmbH
#
# 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.
"""Module LTTng traces/events models."""
class EventMetadata():
"""Container for event metadata."""
def __init__(self, event_name, pid, tid, timestamp, procname, cpu_id) -> None:
self._event_name = event_name
self._pid = pid
self._tid = tid
self._timestamp = timestamp
self._procname = procname
self._cpu_id = cpu_id
@property
def event_name(self):
return self._event_name
@property
def pid(self):
return self._pid
@property
def tid(self):
return self._tid
@property
def timestamp(self):
return self._timestamp
@property
def procname(self):
return self._procname
@property
def cpu_id(self):
return self._cpu_id

View file

@ -19,8 +19,8 @@ import argparse
import time
from tracetools_analysis.loading import load_pickle
from tracetools_analysis.analysis.cpu_time_processor import CpuTimeProcessor
from tracetools_analysis.analysis.ros2_processor import Ros2Processor
from tracetools_analysis.processor.cpu_time import CpuTimeProcessor
from tracetools_analysis.processor.ros2 import Ros2Processor
def parse_args():

View file

@ -18,9 +18,9 @@ from typing import Dict
from tracetools_read.utils import get_field
from .data_model.cpu_time import CpuTimeDataModel
from ..data_model.cpu_time import CpuTimeDataModel
from .handler import EventHandler
from .lttng_models import EventMetadata
from .handler import EventMetadata
class CpuTimeProcessor(EventHandler):

View file

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Module for event handler."""
"""Module for event handling."""
from typing import Callable
from typing import Dict
@ -21,7 +21,41 @@ from typing import List
from tracetools_read.utils import get_event_name
from tracetools_read.utils import get_field
from .lttng_models import EventMetadata
class EventMetadata():
"""Container for event metadata."""
def __init__(self, event_name, pid, tid, timestamp, procname, cpu_id) -> None:
self._event_name = event_name
self._pid = pid
self._tid = tid
self._timestamp = timestamp
self._procname = procname
self._cpu_id = cpu_id
@property
def event_name(self):
return self._event_name
@property
def pid(self):
return self._pid
@property
def tid(self):
return self._tid
@property
def timestamp(self):
return self._timestamp
@property
def procname(self):
return self._procname
@property
def cpu_id(self):
return self._cpu_id
class EventHandler():

View file

@ -18,9 +18,9 @@ from typing import Dict
from tracetools_read.utils import get_field
from .data_model.ros import RosDataModel
from ..data_model.ros import RosDataModel
from .handler import EventHandler
from .lttng_models import EventMetadata
from .handler import EventMetadata
class Ros2Processor(EventHandler):