예제 #1
0
    def test_container_convergence_no_matching_results(self):
        """
        container_convergence only considers results which have the
        'wallclock' metric and are for the 'create-container' operation.
        None is returned if no results match.
        """
        results = [
            {
                'metric': {
                    'type': 'cputime'
                },
                'operation': {
                    'type': 'create-container'
                },
                'value': 4
            },
            {
                'metric': {
                    'type': 'wallclock'
                },
                'operation': {
                    'type': 'read-request'
                },
                'value': 10,
            },
        ]

        convergence_results = container_convergence(results, 10)
        self.assertEqual(convergence_results, None)
예제 #2
0
    def test_container_convergence_no_matching_results(self):
        """
        container_convergence only considers results which have the
        'wallclock' metric and are for the 'create-container' operation.
        None is returned if no results match.
        """
        results = [
            {
                'metric': {
                    'type': 'cputime'
                },
                'operation': {
                    'type': 'create-container'
                },
                'value': 4
            },
            {
                'metric': {
                    'type': 'wallclock'
                },
                'operation': {
                    'type': 'read-request'
                },
                'value': 10,
            },
        ]

        convergence_results = container_convergence(results, 10)
        self.assertEqual(convergence_results, None)
예제 #3
0
    def test_container_convergence_no_matching_results(self):
        """
        container_convergence only considers results which have the
        'wallclock' metric and are for the 'create-container' operation.
        None is returned if no results match.
        """
        results = [
            {"metric": {"type": "cputime"}, "operation": {"type": "create-container"}, "value": 4},
            {"metric": {"type": "wallclock"}, "operation": {"type": "read-request"}, "value": 10},
        ]

        convergence_results = container_convergence(results, 10)
        self.assertEqual(convergence_results, None)
예제 #4
0
 def test_container_convergence_calculates_result(self):
     """
     container_convergence returns the percentage of
     'create-container' operations that completed within the
     specified time limit.
     """
     results = [
         {"metric": {"type": "wallclock"}, "operation": {"type": "create-container"}, "value": 4},
         {"metric": {"type": "wallclock"}, "operation": {"type": "create-container"}, "value": 2},
         {"metric": {"type": "wallclock"}, "operation": {"type": "create-container"}, "value": 5},
         {"metric": {"type": "wallclock"}, "operation": {"type": "create-container"}, "value": 9},
     ]
     convergence_results = container_convergence(results, 5)
     self.assertEqual(convergence_results, 0.75)
예제 #5
0
 def test_container_convergence_calculates_result(self):
     """
     container_convergence returns the percentage of
     'create-container' operations that completed within the
     specified time limit.
     """
     results = [
         {
             'metric': {
                 'type': 'wallclock'
             },
             'operation': {
                 'type': 'create-container'
             },
             'value': 4
         },
         {
             'metric': {
                 'type': 'wallclock'
             },
             'operation': {
                 'type': 'create-container'
             },
             'value': 2
         },
         {
             'metric': {
                 'type': 'wallclock'
             },
             'operation': {
                 'type': 'create-container'
             },
             'value': 5
         },
         {
             'metric': {
                 'type': 'wallclock'
             },
             'operation': {
                 'type': 'create-container'
             },
             'value': 9,
         },
     ]
     convergence_results = container_convergence(results, 5)
     self.assertEqual(convergence_results, 0.75)
예제 #6
0
 def test_container_convergence_calculates_result(self):
     """
     container_convergence returns the percentage of
     'create-container' operations that completed within the
     specified time limit.
     """
     results = [
         {
             'metric': {
                 'type': 'wallclock'
             },
             'operation': {
                 'type': 'create-container'
             },
             'value': 4
         },
         {
             'metric': {
                 'type': 'wallclock'
             },
             'operation': {
                 'type': 'create-container'
             },
             'value': 2
         },
         {
             'metric': {
                 'type': 'wallclock'
             },
             'operation': {
                 'type': 'create-container'
             },
             'value': 5
         },
         {
             'metric': {
                 'type': 'wallclock'
             },
             'operation': {
                 'type': 'create-container'
             },
             'value': 9,
         },
     ]
     convergence_results = container_convergence(results, 5)
     self.assertEqual(convergence_results, 0.75)