def METHOD_NAME(self):
    try:
        from clip_client import Client
    except ImportError:
        raise ImportError(
            'clip_client module is not available. it is required for benchmarking.'
            'Please use ""pip install clip-client" to install it.'
        )
    if self.modality == 'text':
        from clip_server.model.simple_tokenizer import SimpleTokenizer
        tokenizer = SimpleTokenizer()
        vocab = list(tokenizer.encoder.keys())
        batch = DocumentArray(
            [
                Document(text=' '.join(random.choices(vocab, k=78)))
                for _ in range(self.batch_size)
            ]
        )
    elif self.modality == 'image':
        batch = DocumentArray(
            [
                Document(blob=open(self.image_sample, 'rb').read())
                for _ in range(self.batch_size)
            ]
        )
    else:
        raise ValueError(f'The modality "{self.modality}" is unsupported')
    client = Client(self.server)
    time_costs = []
    for _ in range(self.num_iter):
        start = time.perf_counter()
        r = client.encode(batch, batch_size=self.batch_size)
        time_costs.append(time.perf_counter() - start)
    self.avg_time = np.mean(time_costs[2:])