Add method to count records in the storage.