Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes null pointer issues with Interval Results map #1255

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2294,6 +2294,7 @@ public void fetchMetricsBasedOnProfileAndDatasource(KruizeObject kruizeObject, T
// Iterate over fetched metrics
Timestamp sTime = new Timestamp(interval_start_time_epoc);
for (JsonElement element : valuesArray) {

JsonArray valueArray = element.getAsJsonArray();
long epochTime = valueArray.get(0).getAsLong();
double value = valueArray.get(1).getAsDouble();
Expand All @@ -2303,9 +2304,13 @@ public void fetchMetricsBasedOnProfileAndDatasource(KruizeObject kruizeObject, T
Timestamp eTime = CommonUtils.getNearestTimestamp(containerDataResults, tempTime, 5);

// containerDataResults are empty so will use the prometheus timestamp
if (null == eTime)
eTime = tempTime;

if (null == eTime) {
// eTime = tempTime;
// Skipping entry, as inconsistency with CPU & memory records may provide null pointer while accessing metric results
// TODO: Need to seperate the data records of CPU and memory based on exporter
// TODO: Perform recommendation generation by stitching the outcome
continue;
}
// Prepare interval results

if (containerDataResults.containsKey(eTime)) {
Expand Down
Loading