meterer.resource_size(resource_name) -> int

        Retrieve the size of the given resource.

def resource_size(self, resource_name): # pylint: disable=R0201
        """
        meterer.resource_size(resource_name) -> int

        Retrieve the size of the given resource.
        """
        cached_size = self.get_cached_resource_size(resource_name)
        if cached_size is not None:
            return cached_size["size"]

        # Not cached or cache timeout exceeded. Get the actual size and record
        # it in the cache.
        actual_size = self.get_actual_resource_size(resource_name)
        self.set_cached_resource_size(resource_name, actual_size)
        return actual_size