Exemple #1
0
 def testGroupMissing(self):
     r1 = {
         "client": "",
         "command_line": "",
         "groups": {"read": {"group": "read", "statistics": {"Operations": 100, "Return=0": 100}, "histogram": []}},
     }
     r2 = {
         "client": "",
         "command_line": "",
         "groups": {
             "read": {
                 "group": "read",
                 "statistics": {"Operations": 96, "Return=0": 94, "Return=-1": 2},
                 "histogram": [],
             },
             "update": {
                 "group": "update",
                 "statistics": {"Operations": 100, "AverageLatency(ms)": 25},
                 "histogram": [],
             },
         },
     }
     combined = ycsb._CombineResults([r1, r2])
     self.assertItemsEqual(["read", "update"], combined["groups"])
     self.assertItemsEqual(["Operations", "Return=0", "Return=-1"], combined["groups"]["read"]["statistics"])
     read_stats = combined["groups"]["read"]["statistics"]
     self.assertEqual({"Operations": 196, "Return=0": 194, "Return=-1": 2}, read_stats)
Exemple #2
0
    def testDropUnaggregatedFromSingleResult(self):
        r = {
            "client": "",
            "command_line": "",
            "groups": {"read": {"group": "read", "statistics": {"AverageLatency(ms)": 21}, "histogram": []}},
        }

        r_copy = copy.deepcopy(r)
        self.assertEqual(r, r_copy)
        combined = ycsb._CombineResults([r])
        self.assertEqual(r, r_copy)
        r["groups"]["read"]["statistics"] = {}
        self.assertEqual(r, combined)
Exemple #3
0
 def testGroupMissing(self):
     r1 = {
         'client': '',
         'command_line': '',
         'groups': {
             'read': {
                 'group': 'read',
                 'statistics': {
                     'Operations': 100,
                     'Return=0': 100
                 },
                 'histogram': []
             }
         }
     }
     r2 = {
         'client': '',
         'command_line': '',
         'groups': {
             'read': {
                 'group': 'read',
                 'statistics': {
                     'Operations': 96,
                     'Return=0': 94,
                     'Return=-1': 2
                 },
                 'histogram': []
             },
             'update': {
                 'group': 'update',
                 'statistics': {
                     'Operations': 100,
                     'AverageLatency(ms)': 25
                 },
                 'histogram': []
             }
         }
     }
     combined = ycsb._CombineResults([r1, r2], 'histogram', {})
     self.assertItemsEqual(['read', 'update'], combined['groups'])
     self.assertItemsEqual(['Operations', 'Return=0', 'Return=-1'],
                           combined['groups']['read']['statistics'])
     read_stats = combined['groups']['read']['statistics']
     self.assertEqual({
         'Operations': 196,
         'Return=0': 194,
         'Return=-1': 2
     }, read_stats)
Exemple #4
0
  def testDropUnaggregatedFromSingleResult(self):
    r = {
        'client': '',
        'command_line': '',
        'groups': {
            'read': {
                'group': 'read',
                'statistics': {'AverageLatency(ms)': 21},
                'histogram': []
            }
        }
    }

    r_copy = copy.deepcopy(r)
    self.assertEqual(r, r_copy)
    combined = ycsb._CombineResults([r], 'histogram', {})
    self.assertEqual(r, r_copy)
    r['groups']['read']['statistics'] = {}
    self.assertEqual(r, combined)
  def testDropUnaggregatedFromSingleResult(self):
    r = {
        'client': '',
        'command_line': '',
        'groups': {
            'read': {
                'group': 'read',
                'statistics': {'AverageLatency(ms)': 21},
                'histogram': []
            }
        }
    }

    r_copy = copy.deepcopy(r)
    self.assertEqual(r, r_copy)
    combined = ycsb._CombineResults([r])
    self.assertEqual(r, r_copy)
    r['groups']['read']['statistics'] = {}
    self.assertEqual(r, combined)
 def testGroupMissing(self):
   r1 = {
       'client': '',
       'command_line': '',
       'groups': {
           'read': {
               'group': 'read',
               'statistics': {'Operations': 100,
                              'Return=0': 100},
               'histogram': []
           }
       }
   }
   r2 = {
       'client': '',
       'command_line': '',
       'groups': {
           'read': {
               'group': 'read',
               'statistics': {'Operations': 96, 'Return=0': 94,
                              'Return=-1': 2},
               'histogram': []
           },
           'update': {
               'group': 'update',
               'statistics': {'Operations': 100,
                              'AverageLatency(ms)': 25},
               'histogram': []
           }
       }
   }
   combined = ycsb._CombineResults([r1, r2])
   self.assertItemsEqual(['read', 'update'], combined['groups'])
   self.assertItemsEqual(['Operations', 'Return=0', 'Return=-1'],
                         combined['groups']['read']['statistics'])
   read_stats = combined['groups']['read']['statistics']
   self.assertEqual({'Operations': 196, 'Return=0': 194, 'Return=-1': 2},
                    read_stats)