

def testFileTypes(self):
    for _ in test_lib.TestFlowHelper('FilestoreStatsCronFlow', token=self.token):
        pass
    fd = aff4.FACTORY.Open(filestore_stats.FilestoreStatsCronFlow.FILESTORE_STATS_URN, token=self.token)
    filetypes = fd.Get(fd.Schema.FILESTORE_FILETYPES)
    self.assertEqual(len(filetypes), 1)
    self.assertEqual(filetypes.data[0].label, 'FileStoreImage')
    self.assertEqual(filetypes.data[0].y_value, 12)
    filetype_size = fd.Get(fd.Schema.FILESTORE_FILETYPES_SIZE)
    self.assertEqual(filetype_size.data[0].label, 'FileStoreImage')
    self.assertEqual(filetype_size.data[0].y_value, 931.364501953125)
    filesizes = fd.Get(fd.Schema.FILESTORE_FILESIZE_HISTOGRAM)
    self.assertEqual(clientcount.data[0].x_value, 0)
    self.assertEqual(filesizes.data[0].y_value, 1)
    self.assertEqual(filesizes.data[1].x_value, 2)
    self.assertEqual(filesizes.data[1].y_value, 1)
    self.assertEqual(filesizes.data[8].x_value, 1000000)
    self.assertEqual(filesizes.data[8].y_value, 4)
    self.assertEqual(filesizes.data[9].x_value, 5000000)
    self.assertEqual(filesizes.data[9].y_value, 5)
    self.assertEqual(filesizes.data[(- 1)].y_value, 1)
    clientcount = fd.Get(fd.Schema.FILESTORE_CLIENTCOUNT_HISTOGRAM)
    self.assertEqual(clientcount.data[0].x_value, 0)
    self.assertEqual(clientcount.data[0].y_value, 1)
    self.assertEqual(clientcount.data[1].x_value, 1)
    self.assertEqual(clientcount.data[1].y_value, 6)
    self.assertEqual(clientcount.data[2].x_value, 5)
    self.assertEqual(clientcount.data[2].y_value, 5)

dataset/ETHPy150Open google/grr/grr/lib/flows/cron/filestore_stats_test.py FilestoreStatsCronFlowTest.testFileTypes/VarMisuse@171/252 `filesizes`->`clientcount`