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.
log_linearized_curve_overlays
Tyler Goodlet 2023-03-07 15:35:07 -05:00
parent 8d1c713a5a
commit 5958acebe1
1 changed files with 28 additions and 18 deletions

View File

@ -32,6 +32,7 @@ from typing import (
import tractor
import trio
import pyqtgraph as pg
# import pendulum
from msgspec import field
@ -187,8 +188,6 @@ class DisplayState(Struct):
'i_last': 0,
'i_last_append': 0,
'last_mx_vlm': 0,
# 'last_mx': 0,
# 'last_mn': 0,
}
)
hist_vars: dict[str, Any] = field(
@ -196,8 +195,6 @@ class DisplayState(Struct):
'i_last': 0,
'i_last_append': 0,
'last_mx_vlm': 0,
# 'last_mx': 0,
# 'last_mn': 0,
}
)
@ -773,20 +770,33 @@ def graphics_update_cycle(
)
profiler('main vb y-autorange')
# SLOW CHART y-auto-range resize case
(
_,
hist_liv,
_,
_,
_,
_,
_,
) = hist_viz.incr_info(
ds=ds,
is_1m=True,
)
profiler('hist `Viz.incr_info()`')
# SLOW CHART y-auto-range resize casd
# (NOTE: still is still inside the y-range
# guard block above!)
# (
# _,
# hist_liv,
# _,
# _,
# _,
# _,
# _,
# ) = hist_viz.incr_info(
# ds=ds,
# 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
# if (