コード例 #1
0
ファイル: test_benchmark.py プロジェクト: calston/tums
 def testPartitionLineParser(self):
     """
     Test parsing the other kind of line that can show up in the diskstats
     file.
     """
     s = "3    1 hda1 2 5 7 9"
     device, stat = benchmark.parseDiskStatLine(s)
     self.assertEquals(device, 'hda1')
     self.assertEquals(stat.readCount, 2)
     self.assertEquals(stat.readSectorCount, 5)
     self.assertEquals(stat.writeCount, 7)
     self.assertEquals(stat.writeSectorCount, 9)
コード例 #2
0
 def testPartitionLineParser(self):
     """
     Test parsing the other kind of line that can show up in the diskstats
     file.
     """
     s = "3    1 hda1 2 5 7 9"
     device, stat = benchmark.parseDiskStatLine(s)
     self.assertEqual(device, 'hda1')
     self.assertEqual(stat.readCount, 2)
     self.assertEqual(stat.readSectorCount, 5)
     self.assertEqual(stat.writeCount, 7)
     self.assertEqual(stat.writeSectorCount, 9)
コード例 #3
0
ファイル: test_benchmark.py プロジェクト: calston/tums
 def testDiskLineParser(self):
     """
     Test the parsing of a single line into a single diststat instance.
     """
     s = ("3    0 hda 267481 3913 3944418 1625467 3392405 3781877 58210592 "
          "150845143 0 6136300 153333793")
     device, stat = benchmark.parseDiskStatLine(s)
     self.assertEquals(device, 'hda')
     self.assertEquals(stat.readCount, 267481)
     self.assertEquals(stat.mergedReadCount, 3913)
     self.assertEquals(stat.readSectorCount, 3944418)
     self.assertEquals(stat.readMilliseconds, 1625467)
     self.assertEquals(stat.writeCount, 3392405)
     self.assertEquals(stat.mergedWriteCount, 3781877)
     self.assertEquals(stat.writeSectorCount, 58210592)
     self.assertEquals(stat.writeMilliseconds, 150845143)
     self.assertEquals(stat.outstandingIOCount, 0)
     self.assertEquals(stat.ioMilliseconds, 6136300)
     self.assertEquals(stat.weightedIOMilliseconds, 153333793)
コード例 #4
0
 def testDiskLineParser(self):
     """
     Test the parsing of a single line into a single diststat instance.
     """
     s = ("3    0 hda 267481 3913 3944418 1625467 3392405 3781877 58210592 "
          "150845143 0 6136300 153333793")
     device, stat = benchmark.parseDiskStatLine(s)
     self.assertEqual(device, 'hda')
     self.assertEqual(stat.readCount, 267481)
     self.assertEqual(stat.mergedReadCount, 3913)
     self.assertEqual(stat.readSectorCount, 3944418)
     self.assertEqual(stat.readMilliseconds, 1625467)
     self.assertEqual(stat.writeCount, 3392405)
     self.assertEqual(stat.mergedWriteCount, 3781877)
     self.assertEqual(stat.writeSectorCount, 58210592)
     self.assertEqual(stat.writeMilliseconds, 150845143)
     self.assertEqual(stat.outstandingIOCount, 0)
     self.assertEqual(stat.ioMilliseconds, 6136300)
     self.assertEqual(stat.weightedIOMilliseconds, 153333793)