Beispiel #1
0
    def get_performance(result, event_monitor, result_monitor):
        event_count = nexmark_util.get_counter_metric(
            result, event_monitor.namespace,
            event_monitor.name_prefix + MonitorSuffix.ELEMENT_COUNTER)
        event_start = nexmark_util.get_start_time_metric(
            result, event_monitor.namespace,
            event_monitor.name_prefix + MonitorSuffix.EVENT_TIME)
        event_end = nexmark_util.get_end_time_metric(
            result, event_monitor.namespace,
            event_monitor.name_prefix + MonitorSuffix.EVENT_TIME)
        result_count = nexmark_util.get_counter_metric(
            result, result_monitor.namespace,
            result_monitor.name_prefix + MonitorSuffix.ELEMENT_COUNTER)
        result_end = nexmark_util.get_end_time_metric(
            result, result_monitor.namespace,
            result_monitor.name_prefix + MonitorSuffix.EVENT_TIME)

        perf = NexmarkPerf()
        perf.event_count = event_count
        perf.result_count = result_count
        effective_end = max(event_end, result_end)
        if effective_end >= 0 and event_start >= 0:
            perf.runtime_sec = (effective_end - event_start) / 1000
        if event_count >= 0 and perf.runtime_sec > 0:
            perf.event_per_sec = event_count / perf.runtime_sec

        return perf
    def get_performance(result, event_monitor, result_monitor):
        event_count = nexmark_util.get_counter_metric(
            result, event_monitor.namespace,
            event_monitor.name_prefix + MonitorSuffix.ELEMENT_COUNTER)
        event_start = nexmark_util.get_start_time_metric(
            result, event_monitor.namespace,
            event_monitor.name_prefix + MonitorSuffix.EVENT_TIME)
        event_end = nexmark_util.get_end_time_metric(
            result, event_monitor.namespace,
            event_monitor.name_prefix + MonitorSuffix.EVENT_TIME)
        result_count = nexmark_util.get_counter_metric(
            result, result_monitor.namespace,
            result_monitor.name_prefix + MonitorSuffix.ELEMENT_COUNTER)
        result_end = nexmark_util.get_end_time_metric(
            result, result_monitor.namespace,
            result_monitor.name_prefix + MonitorSuffix.EVENT_TIME)

        effective_end = max(event_end, result_end)
        runtime_sec = (effective_end - event_start) / 1000
        event_per_sec = event_count / runtime_sec
        logging.info('input event count: %d, output event count: %d' %
                     (event_count, result_count))
        logging.info(
            'query run took %.1f seconds and processed %.1f events per second'
            % (runtime_sec, event_per_sec))