Add (commented) draft 1min OHLC time index logging

For the purposes of eventually trying to resolve last-step indexing
synchronization (an intermittent but still existing) issue(s) that can
happen due to races during history frame query and shm writing during
startup. In fact, here we drop all `hist_viz` info queries from the main
display loop for now anticipating that this code will either be removed
or improved later.
storage_cli
Tyler Goodlet 2023-03-07 15:35:07 -05:00
parent 0cfad6838d
commit ddd1722a0a
1 changed files with 28 additions and 18 deletions

View File

@ -32,6 +32,7 @@ from typing import (
import tractor import tractor
import trio import trio
import pyqtgraph as pg import pyqtgraph as pg
# import pendulum
from msgspec import field from msgspec import field
@ -187,8 +188,6 @@ class DisplayState(Struct):
'i_last': 0, 'i_last': 0,
'i_last_append': 0, 'i_last_append': 0,
'last_mx_vlm': 0, 'last_mx_vlm': 0,
# 'last_mx': 0,
# 'last_mn': 0,
} }
) )
hist_vars: dict[str, Any] = field( hist_vars: dict[str, Any] = field(
@ -196,8 +195,6 @@ class DisplayState(Struct):
'i_last': 0, 'i_last': 0,
'i_last_append': 0, 'i_last_append': 0,
'last_mx_vlm': 0, 'last_mx_vlm': 0,
# 'last_mx': 0,
# 'last_mn': 0,
} }
) )
@ -773,20 +770,33 @@ def graphics_update_cycle(
) )
profiler('main vb y-autorange') profiler('main vb y-autorange')
# SLOW CHART y-auto-range resize case # SLOW CHART y-auto-range resize casd
( # (NOTE: still is still inside the y-range
_, # guard block above!)
hist_liv, # (
_, # _,
_, # hist_liv,
_, # _,
_, # _,
_, # _,
) = hist_viz.incr_info( # _,
ds=ds, # _,
is_1m=True, # ) = hist_viz.incr_info(
) # ds=ds,
profiler('hist `Viz.incr_info()`') # is_1m=True,
# )
# if hist_liv:
# times = hist_viz.shm.array['time']
# last_t = times[-1]
# dt = pendulum.from_timestamp(last_t)
# log.info(
# f'{hist_viz.name} TIMESTEP:'
# f'epoch: {last_t}\n'
# f'datetime: {dt}\n'
# )
# profiler('hist `Viz.incr_info()`')
# hist_chart = ds.hist_chart # hist_chart = ds.hist_chart
# if ( # if (