37 lines
1.2 KiB
Python
37 lines
1.2 KiB
Python
|
|
#!/usr/bin/env python3
|
||
|
|
"""
|
||
|
|
FAST ExF Fetcher - 100ms HZ Push Interval
|
||
|
|
==========================================
|
||
|
|
Optimized version with 5x faster Hazelcast updates (100ms vs 500ms).
|
||
|
|
|
||
|
|
Trade-offs:
|
||
|
|
- Latency: 100ms (vs 500ms) = 5x faster
|
||
|
|
- CPU: ~5% more usage (acceptable)
|
||
|
|
- Network: 5x more HZ writes (acceptable for localhost)
|
||
|
|
|
||
|
|
Use this when you need sub-100ms data freshness.
|
||
|
|
"""
|
||
|
|
|
||
|
|
import sys
|
||
|
|
sys.path.insert(0, '/mnt/dolphinng5_predict')
|
||
|
|
sys.path.insert(0, '/mnt/dolphinng5_predict/external_factors')
|
||
|
|
sys.path.insert(0, '/mnt/dolphinng5_predict/prod')
|
||
|
|
|
||
|
|
# Just change the interval constant and import the main flow
|
||
|
|
import exf_fetcher_flow
|
||
|
|
exf_fetcher_flow.HZ_PUSH_INTERVAL_S = 0.1 # 100ms instead of 500ms
|
||
|
|
exf_fetcher_flow.LOG_STATUS_INTERVAL = 600 # Log every 60 seconds (600 * 0.1s)
|
||
|
|
|
||
|
|
# Re-run the main flow
|
||
|
|
if __name__ == "__main__":
|
||
|
|
import argparse
|
||
|
|
parser = argparse.ArgumentParser(description="DOLPHIN ExF fast daemon (100ms)")
|
||
|
|
parser.add_argument("--warmup", type=int, default=exf_fetcher_flow.WARMUP_S)
|
||
|
|
args = parser.parse_args()
|
||
|
|
|
||
|
|
print("=" * 60)
|
||
|
|
print("FAST ExF Mode: HZ push every 100ms")
|
||
|
|
print("=" * 60)
|
||
|
|
|
||
|
|
exf_fetcher_flow.exf_fetcher_flow(warmup_s=args.warmup)
|