'Check client ping stats are updated.'

def testClientPingStatsUpdated(self):

    new_client = self.MakeClientAFF4Record()
    self.assertEqual(stats.STATS.GetMetricValue('client_pings_by_label', fields=['testlabel']), 0)
    with aff4.FACTORY.Open(new_client.urn, mode='rw', token=self.token) as client_object:
        client_object.AddLabels('testlabel')
        client_object.Flush(sync=True)
    now = rdfvalue.RDFDatetime.Now()
    with test_lib.FakeTime(now):
        self.ClientServerCommunicate(timestamp=now)
        self.assertEqual(stats.STATS.GetMetricValue('client_pings_by_label', fields=['testlabel']), 1)
