Esempio n. 1
0
    def _record_average_page_timings_from_cached_session(
            self, session_count=DEFAULT_SESSION_SAMPLE_COUNT):
        page_session_metrics_list = []

        for _ in range(session_count):
            page_session_metrics_list.append(
                self.data_fetcher.get_page_timings_from_cached_session(
                    self.page_url))

        self.page_metrics = perf_domain.MultiplePageSessionMetrics(
            page_session_metrics_list)
Esempio n. 2
0
    def _record_average_page_timings_from_uncached_session(
            self, session_count=DEFAULT_SESSION_SAMPLE_COUNT):
        """Records average page timings from uncached session.

        Args:
            session_count: int. Number of page load sessions used to
                collect timing metrics. Defaults to
                DEFAULT_SESSION_SAMPLE_COUNT.
        """
        page_session_metrics_list = []

        for _ in python_utils.RANGE(session_count):
            page_session_metrics_list.append(
                self.data_fetcher.get_page_timings_from_uncached_session(
                    self.page_url))

        self.page_metrics = perf_domain.MultiplePageSessionMetrics(
            page_session_metrics_list)