Merge pull request #7551 from wizrds/fix/test-ws-client

Test WS Client typo fix
This commit is contained in:
Matthias 2022-10-07 19:24:41 +02:00 committed by GitHub
commit bc09c812a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -170,15 +170,15 @@ class ClientProtocol:
def _calculate_time_difference(self): def _calculate_time_difference(self):
old_last_received_at = self._LAST_RECEIVED_AT old_last_received_at = self._LAST_RECEIVED_AT
self._LAST_RECEIVED_AT = time.time() self._LAST_RECEIVED_AT = time.time() * 1000
time_delta = relativedelta(seconds=(self._LAST_RECEIVED_AT - old_last_received_at)) time_delta = relativedelta(microseconds=(self._LAST_RECEIVED_AT - old_last_received_at))
return readable_timedelta(time_delta) return readable_timedelta(time_delta)
async def _handle_whitelist(self, name, type, data): async def _handle_whitelist(self, name, type, data):
self.logger.info(data) self.logger.info(data)
async def _handle_default(self, name, type, data): async def _handle_analyzed_df(self, name, type, data):
key, la, df = data['key'], data['la'], data['df'] key, la, df = data['key'], data['la'], data['df']
if not df.empty: if not df.empty:
@ -189,6 +189,12 @@ class ClientProtocol:
self.logger.info(f"Latest candle datetime: {df.iloc[-1]['date']}") self.logger.info(f"Latest candle datetime: {df.iloc[-1]['date']}")
self.logger.info(f"DataFrame length: {len(df)}") self.logger.info(f"DataFrame length: {len(df)}")
self.logger.info(f"DataFrame columns: {columns}") self.logger.info(f"DataFrame columns: {columns}")
else:
self.logger.info("Empty DataFrame")
async def _handle_default(self, name, type, data):
self.logger.info("Unkown message of type {type} received...")
self.logger.info(data)
async def create_client( async def create_client(