From a9f2af98ff2e3833c7b2a41b89ecf2415c3522cf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Henning?= <post@soeren-henning.de>
Date: Fri, 17 Apr 2020 18:17:07 +0200
Subject: [PATCH] Add support for NaN return from Prometheus

---
 execution/lag_analysis.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/execution/lag_analysis.py b/execution/lag_analysis.py
index 59475620b..e13895867 100644
--- a/execution/lag_analysis.py
+++ b/execution/lag_analysis.py
@@ -4,7 +4,7 @@ import requests
 from datetime import datetime, timedelta, timezone
 import pandas as pd
 import matplotlib.pyplot as plt
-import csv   
+import csv
 
 #
 exp_id =  sys.argv[1]
@@ -45,7 +45,7 @@ for result in results:
     topic = result['metric']['topic']
     for value in result['values']:
         #print(value)
-        d.append({'topic': topic, 'timestamp': int(value[0]), 'value': int(value[1])})
+        d.append({'topic': topic, 'timestamp': int(value[0]), 'value': int(value[1]) if value[1] != 'NaN' else 0})
 
 df = pd.DataFrame(d)
 
-- 
GitLab