def __exec(self, method, params=None): """Perform a single steemd call.""" start = perf() result = self._client.exec(method, params) items = len(params[0]) if method == 'get_accounts' else 1 Stats.log_steem(method, perf() - start, items) return result
def __exec(self, method, params=None): """Perform a single steemd call.""" time_start = time.perf_counter() result = self._client.exec(method, params) total_time = (time.perf_counter() - time_start) * 1000 batch_size = len(params[0]) if method == 'get_accounts' else 1 Stats.log_steem(method, total_time, batch_size) return result
def __exec_batch(self, method, params): """Perform batch call. Based on config uses either batch or futures.""" start = perf() result = [] for part in self._client.exec_multi(method, params, max_workers=self._max_workers, batch_size=self._max_batch): result.extend(part) Stats.log_steem(method, perf() - start, len(params)) return result
def __exec_batch(self, method, params): """Perform batch call. Based on config uses either batch or futures.""" time_start = time.perf_counter() result = [] for part in self._client.exec_multi(method, params, max_workers=self._max_workers, batch_size=self._max_batch): result.extend(part) total_time = (time.perf_counter() - time_start) * 1000 Stats.log_steem(method, total_time, len(params)) return result