def _create_time_visualization(job, args):
        """
        Args:
            job: fedlearner_webconsole.job.models.Job. Current job to plot.
            args: dict. reqparse args, must contain 'aggregator', 'value_field'
                and 'metric_name' entries, and the values must not be None.

        Returns:
            list of dict and tuple. A list of Timelion vis states and
            (start time, end time) of visualization.

        """
        query = 'tags.application_id:{}'.format(job.name)
        if args['query']:
            query += ' AND ({})'.format(args['query'])
        index = Kibana.JOB_INDEX.get(job.job_type, 'metrics') + '*'
        et = 'tags.event_time'
        pt = 'tags.process_time'
        interval = args['interval'] if args['interval'] != '' else 'auto'
        vis_states = []
        # first by process time, then by event time
        for t1, t2 in ((et, pt), (pt, et)):
            # t1 vs t2, max/min/median of t1 as Y axis, t2 as X axis
            # aggregate on t1 and histogram on t2
            max_series = Kibana._timelion_series(
                query=query, index=index,
                metric='max:' + t1, timefield=t2
            )
            min_series = Kibana._timelion_series(
                query=query, index=index,
                metric='min:' + t1, timefield=t2
            )
            median_series = Kibana._timelion_series(
                query=query, index=index,
                metric='percentiles:' + t1 + ':50', timefield=t2
            )
            series = ','.join((max_series, min_series, median_series))
            vis_state = {"type": "timelion",
                         "params": {"expression": series,
                                    "interval": interval},
                         "aggs": []}
            vis_states.append(vis_state)
        by_pt_start = Kibana._get_start_from_job(job)
        by_pt_end = 'now'
        by_et_start, by_et_end = Kibana._parse_start_end_time(args)
        return vis_states, [(by_pt_start, by_pt_end), (by_et_start, by_et_end)]

        Args:
            job: fedlearner_webconsole.job.models.Job. Current job to plot.
            args: dict. reqparse args, must contain 'aggregator', 'value_field'
                and 'metric_name' entries, and the values must not be None.

        Returns:
            list of dict and tuple. A list of Timelion vis states and
            (start time, end time) of visualization.

        
web_console_v2/api/fedlearner_webconsole/utils/kibana.py