diff --git a/piker/brokers/binance/feed.py b/piker/brokers/binance/feed.py index 4611f0ef..21448a6c 100644 --- a/piker/brokers/binance/feed.py +++ b/piker/brokers/binance/feed.py @@ -192,7 +192,7 @@ async def stream_messages( piker_quote: dict = { 'symbol': msg.s, 'last': float(msg.p), - 'brokerd_ts': time.time(), + 'datad_ts': time.time(), 'ticks': [{ 'type': 'trade', 'price': float(msg.p), diff --git a/piker/brokers/core.py b/piker/brokers/core.py index 937f384c..6ef35fa7 100644 --- a/piker/brokers/core.py +++ b/piker/brokers/core.py @@ -131,7 +131,7 @@ async def bars( return await client.bars(symbol, **kwargs) -async def search_w_brokerd( +async def search_w_datad( name: str, pattern: str, ) -> dict: @@ -185,7 +185,7 @@ async def symbol_search( results.append(( brokername, await portal.run( - search_w_brokerd, + search_w_datad, name=brokername, pattern=pattern, ), diff --git a/piker/brokers/deribit/__init__.py b/piker/brokers/deribit/__init__.py index 6e1a4c80..fa1bf7dd 100644 --- a/piker/brokers/deribit/__init__.py +++ b/piker/brokers/deribit/__init__.py @@ -72,6 +72,6 @@ _spawn_kwargs = { } # annotation to let backend agnostic code -# know if ``brokerd`` should be spawned with +# know if ``datad``/``brokerd`` should be spawned with # ``tractor``'s aio mode. _infect_asyncio: bool = True diff --git a/piker/brokers/deribit/feed.py b/piker/brokers/deribit/feed.py index 94fb3f89..e9c34ab3 100644 --- a/piker/brokers/deribit/feed.py +++ b/piker/brokers/deribit/feed.py @@ -150,7 +150,7 @@ async def stream_quotes( first_quote = { 'symbol': sym, 'last': last_trade.price, - 'brokerd_ts': last_trade.timestamp, + 'datad_ts': last_trade.timestamp, 'ticks': [{ 'type': 'trade', 'price': last_trade.price, diff --git a/piker/brokers/ib/__init__.py b/piker/brokers/ib/__init__.py index e9f73b70..0a727507 100644 --- a/piker/brokers/ib/__init__.py +++ b/piker/brokers/ib/__init__.py @@ -84,7 +84,7 @@ _spawn_kwargs = { } # annotation to let backend agnostic code -# know if ``brokerd`` should be spawned with +# know if ``datad``/``brokerd`` should be spawned with # ``tractor``'s aio mode. _infect_asyncio: bool = True diff --git a/piker/brokers/ib/feed.py b/piker/brokers/ib/feed.py index 2abb1d2e..eacc6017 100644 --- a/piker/brokers/ib/feed.py +++ b/piker/brokers/ib/feed.py @@ -1086,7 +1086,7 @@ def normalize( data['tickByTicks'] = [tbt._asdict() for tbt in tbts] # add time stamps for downstream latency measurements - data['brokerd_ts'] = time.time() + data['datad_ts'] = time.time() # stupid stupid shit...don't even care any more.. # leave it until we do a proper latency study diff --git a/piker/brokers/ib/symbols.py b/piker/brokers/ib/symbols.py index 77d4f59e..13d996c2 100644 --- a/piker/brokers/ib/symbols.py +++ b/piker/brokers/ib/symbols.py @@ -189,7 +189,7 @@ _search_conf = { @tractor.context async def open_symbol_search(ctx: tractor.Context) -> None: ''' - Symbology search brokerd-endpoint. + Symbology search `datad` endpoint. ''' from .api import open_client_proxies diff --git a/piker/brokers/kraken/feed.py b/piker/brokers/kraken/feed.py index 298acdca..e0b19a27 100644 --- a/piker/brokers/kraken/feed.py +++ b/piker/brokers/kraken/feed.py @@ -195,7 +195,7 @@ def normalize(ohlc: OHLC) -> dict: ''' quote = ohlc.to_dict() quote['broker_ts'] = quote['time'] - quote['brokerd_ts'] = time.time() + quote['datad_ts'] = time.time() quote['symbol'] = quote['pair'] = quote['pair'].replace('/', '') quote['last'] = quote['close'] quote['bar_wap'] = ohlc.vwap diff --git a/piker/brokers/kucoin.py b/piker/brokers/kucoin.py index bdd551c9..571cbb82 100755 --- a/piker/brokers/kucoin.py +++ b/piker/brokers/kucoin.py @@ -896,7 +896,7 @@ async def iter_normed_quotes( # semantic? can't we just read the ticks with our # .data.ticktools.frame_ticks()`/ 'last': trade_data.price, - 'brokerd_ts': last_trade_ts, + 'datad_ts': last_trade_ts, 'ticks': [ { 'type': 'trade', diff --git a/piker/data/_sampling.py b/piker/data/_sampling.py index 83afe321..4d9c0171 100644 --- a/piker/data/_sampling.py +++ b/piker/data/_sampling.py @@ -600,10 +600,10 @@ async def sample_and_broadcast( ) -> None: ''' - `brokerd`-side task which writes latest datum sampled data. + `datad`-side task which writes latest datum sampled data. This task is meant to run in the same actor (mem space) as the - `brokerd` real-time quote feed which is being sampled to + `datad` real-time quote feed which is being sampled to a ``ShmArray`` buffer. ''' @@ -743,7 +743,7 @@ async def sample_and_broadcast( # AND/OR instead of doing a fan out to TCP sockets # here, we add a shm-style tick queue which readers can # pull from instead of placing the burden of broadcast - # on solely on this `brokerd` actor. see issues: + # solely on this `datad` actor. see issues: # - https://github.com/pikers/piker/issues/98 # - https://github.com/pikers/piker/issues/107 @@ -805,7 +805,8 @@ async def sample_and_broadcast( chan: Channel = ctx.chan if ctx: log.warning( - f'Dropped `brokerd`-feed for {broker_symbol!r} due to,\n' + f'Dropped `datad` feed for ' + f'{broker_symbol!r} due to,\n' f'x>) {ctx.cid}@{chan.uid}' f'|_{ipc_err!r}\n\n' ) diff --git a/piker/data/ticktools.py b/piker/data/ticktools.py index 2a977a63..4a7a2658 100644 --- a/piker/data/ticktools.py +++ b/piker/data/ticktools.py @@ -43,7 +43,7 @@ class FeedQuote(TypedDict, total=False): tradeRate: float volumeRate: float broker_ts: float - brokerd_ts: float + datad_ts: float # tick-type-classes template for all possible "lowest level" events # that can can be emitted by the "top of book" L1 queues and diff --git a/piker/fsp/__init__.py b/piker/fsp/__init__.py index 0651069e..92815424 100644 --- a/piker/fsp/__init__.py +++ b/piker/fsp/__init__.py @@ -68,5 +68,5 @@ async def latency( # This is codified in the per-broker normalization layer # TODO: Add more measure points and diffs for full system # stack tracing. - value = quote['brokerd_ts'] - quote['broker_ts'] + value = quote['datad_ts'] - quote['broker_ts'] yield value diff --git a/piker/service/marketstore.py b/piker/service/marketstore.py index c842a5bd..2e2382dc 100644 --- a/piker/service/marketstore.py +++ b/piker/service/marketstore.py @@ -303,7 +303,7 @@ _quote_dt = [ ('Ask', 'f4'), ('Size', 'i8'), ('Volume', 'i8'), - # ('brokerd_ts', 'i64'), + # ('datad_ts', 'i64'), # ('VWAP', 'f4') ]