diff --git a/execution/lag_analysis.py b/execution/lag_analysis.py index fa30e0e2f590685e3fc7013fb7fc220fd4dbdccd..a810a088a0ead9722e5daf16a65318732d0b7451 100644 --- a/execution/lag_analysis.py +++ b/execution/lag_analysis.py @@ -1,4 +1,5 @@ import sys +import os import requests from datetime import datetime, timedelta, timezone import pandas as pd @@ -10,10 +11,14 @@ exp_id = sys.argv[1] benchmark = sys.argv[2] dim_value = sys.argv[3] instances = sys.argv[4] +time_diff_ms = int(os.getenv('CLOCK_DIFF_MS', 0)) #http://localhost:9090/api/v1/query_range?query=sum%20by(job,topic)(kafka_consumer_consumer_fetch_manager_metrics_records_lag)&start=2015-07-01T20:10:30.781Z&end=2020-07-01T20:11:00.781Z&step=15s -now = datetime.utcnow().replace(tzinfo=timezone.utc).replace(microsecond=0) +now_local = datetime.utcnow().replace(tzinfo=timezone.utc).replace(microsecond=0) +now = now_local - timedelta(milliseconds=time_diff_ms) +print(f"Now Local: {now_local}") +print(f"Now Used: {now}") end = now start = now - timedelta(minutes=5)