'How long does it take to create and set properties.'

def testAFF4CreateAndSet(self):

    client_info = rdf_client.ClientInformation(client_name='GRR', client_description='Description')
    def CreateAFF4Object():
        'Blind    write    a    VFSGRRClient    with    1000    client    info    attributes.'
        fd = aff4.FACTORY.Create('C.1234567812345678', aff4_grr.VFSGRRClient, token=self.token)
        fd.Set(fd.Schema.HOSTNAME('Foobar'))
        for _ in range(1000):
            fd.AddAttribute(fd.Schema.CLIENT_INFO, client_info)
        fd.Close()
    self.TimeIt(CreateAFF4Object, pre=data_store.DB.Clear)
    data_store.DB.Clear()
    CreateAFF4Object()
    def ReadAFF4Object():
        fd = aff4.FACTORY.Open('C.1234567812345678', token=self.token, age=aff4.ALL_TIMES)
        self.assertEqual(fd.Get(fd.Schema.HOSTNAME), 'Foobar')
    self.TimeIt(ReadAFF4Object, name='Read    attribute    from    AFF4Object')
    def ReadVersionedAFF4Attribute():
        fd = aff4.FACTORY.Open('C.1234567812345678', token=self.token, age=aff4.ALL_TIMES)
        for x in fd.GetValuesForAttribute(fd.Schema.CLIENT_INFO):
            self.assertEqual(x.client_name, 'GRR')
    self.TimeIt(ReadVersionedAFF4Attribute, name='Read    heavily    versioned    Attributes')
    def ReadSomeVersionedAFF4Attribute():
        fd = aff4.FACTORY.Open('C.1234567812345678', token=self.token, age=aff4.ALL_TIMES)
        for (i, x) in enumerate(fd.GetValuesForAttribute(fd.Schema.CLIENT_INFO)):
            self.assertEqual(x.client_name, 'GRR')
            if (i > 50):
                break
    self.TimeIt(ReadSomeVersionedAFF4Attribute, name='Read    few    versioned    Attributes')
    def ReadAVersionedAFF4Attribute():
        fd = aff4.FACTORY.Open('C.1234567812345678', token=self.token, age=aff4.ALL_TIMES)
        x = fd.Get(fd.Schema.CLIENT_INFO)
        self.assertEqual(x.client_name, 'GRR')
    self.TimeIt(ReadAVersionedAFF4Attribute, name='Read    one    versioned    Attributes')
