Exemplo n.º 1
0
 def _extract_environment(self, filename):
     """
     Method will process given json filename. Method will also remove entries
         having no information (like missing binaries)
     :param filename:
     :return:
     """
     json_data = read_json(filename)
     JsonPreprocessor.filter(json_data['bins'], 'missing', lambda x: bool(x))
     JsonPreprocessor.delete_props(json_data, ['bins'])
     return json_data
Exemplo n.º 2
0
    def _extract_process_metrics(json_data):
        """
        :type json_data: dict
        :rtype : dict
        """
        fields = dict(exit='exit', duration='duration')

        context = JsonPreprocessor.extract_props(json_data, fields)
        context = JsonPreprocessor.convert_fields(context, int, ['exit'])
        context = JsonPreprocessor.convert_fields(context, float, ['duration'])
        return context
Exemplo n.º 3
0
    def _extract_process_metrics(json_data):
        """
        :type json_data: dict
        :rtype : dict
        """
        fields = dict(exit='exit', duration='duration')

        context = JsonPreprocessor.extract_props(json_data, fields)
        context = JsonPreprocessor.convert_fields(context, int, ['exit'])
        context = JsonPreprocessor.convert_fields(context, float, ['duration'])
        return context
Exemplo n.º 4
0
 def _extract_environment(self, filename):
     """
     Method will process given json filename. Method will also remove entries
         having no information (like missing binaries)
     :param filename:
     :return:
     """
     json_data = read_json(filename)
     JsonPreprocessor.filter(json_data['bins'], 'missing',
                             lambda x: bool(x))
     JsonPreprocessor.delete_props(json_data, ['bins'])
     return json_data
Exemplo n.º 5
0
    def _extract_process_context(json_data):
        """
        :type json_data: dict
        :rtype : dict
        """
        fields = dict(flags='program-flags', branch='program-branch', problem='problem',
                      path='path', task_size='task-size', resolution='timer-resolution',
                      start='run-started-at', nproc='nproc', version='program-revision')

        context = JsonPreprocessor.extract_props(json_data, fields)
        context = JsonPreprocessor.convert_fields(
            context, lambda x: datetime.strptime(x, '%m/%d/%y %H:%M:%S'), ['start'])
        return context
Exemplo n.º 6
0
    def _extract_event_metrics(json_data):
        """
        :type json_data: dict
        :rtype : dict
        """
        fields = dict(call='call-count', call_max='call-count-max',
                      call_min='call-count-min', call_sum='call-count-sum',
                      duration='cumul-time',

                      time='cumul-time', time_max='cumul-time-max',
                      time_min='cumul-time-min', time_sum='cumul-time-sum')

        context = JsonPreprocessor.extract_props(json_data, fields)
        context = JsonPreprocessor.convert_fields(
            context, lambda x: datetime.strptime(x, '%m/%d/%y %H:%M:%S'), ['start'])
        return context
Exemplo n.º 7
0
    def _extract_event_context(json_data):
        """
        :type json_data: dict
        :rtype : dict
        """
        fields = dict(path='file-path', function='function', tag='tag', line='file-line')

        context = JsonPreprocessor.extract_props(json_data, fields)
        return context
Exemplo n.º 8
0
    def _extract_event_metrics(json_data):
        """
        :type json_data: dict
        :rtype : dict
        """
        fields = dict(call='call-count',
                      call_max='call-count-max',
                      call_min='call-count-min',
                      call_sum='call-count-sum',
                      duration='cumul-time',
                      time='cumul-time',
                      time_max='cumul-time-max',
                      time_min='cumul-time-min',
                      time_sum='cumul-time-sum')

        context = JsonPreprocessor.extract_props(json_data, fields)
        context = JsonPreprocessor.convert_fields(
            context, lambda x: datetime.strptime(x, '%m/%d/%y %H:%M:%S'),
            ['start'])
        return context
Exemplo n.º 9
0
    def _extract_process_context(json_data):
        """
        :type json_data: dict
        :rtype : dict
        """
        fields = dict(flags='program-flags',
                      branch='program-branch',
                      problem='problem',
                      path='path',
                      task_size='task-size',
                      resolution='timer-resolution',
                      start='run-started-at',
                      nproc='nproc',
                      version='program-revision')

        context = JsonPreprocessor.extract_props(json_data, fields)
        context = JsonPreprocessor.convert_fields(
            context, lambda x: datetime.strptime(x, '%m/%d/%y %H:%M:%S'),
            ['start'])
        return context
Exemplo n.º 10
0
    def _extract_event_context(json_data):
        """
        :type json_data: dict
        :rtype : dict
        """
        fields = dict(path='file-path',
                      function='function',
                      tag='tag',
                      line='file-line')

        context = JsonPreprocessor.extract_props(json_data, fields)
        return context