Skip to content

Commit

Permalink
Topics per cluster graph defect (#1988)
Browse files Browse the repository at this point in the history
* Fix incorrect check for environments and also remove leading empty space in graph unless there is no data.

Signed-off-by: Aindriu Lavelle <aindriu.lavelle@aiven.io>

* Update to fix the display of graphs on the landing page.

Signed-off-by: Aindriu Lavelle <aindriu.lavelle@aiven.io>

---------

Signed-off-by: Aindriu Lavelle <aindriu.lavelle@aiven.io>
  • Loading branch information
aindriu-aiven authored Nov 16, 2023
1 parent 2d58958 commit e85763e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package io.aiven.klaw.helpers.db.rdbms;

import static io.aiven.klaw.helpers.KwConstants.*;
import static org.reflections.Reflections.log;
import static io.aiven.klaw.helpers.KwConstants.DATE_TIME_DDMMMYYYY_HHMMSS_FORMATTER;
import static io.aiven.klaw.helpers.KwConstants.REQUESTOR_SUBSCRIPTIONS;

import com.google.common.collect.Lists;
import io.aiven.klaw.dao.*;
Expand Down Expand Up @@ -1284,14 +1285,15 @@ public List<CommonUtilsService.ChartsOverviewItem<Integer, Integer>> selectAclsC

Map<String, Env> name2envsFromDb =
StreamSupport.stream(selectEnvsDetails(envIds.keySet(), tenantId).spliterator(), false)
.collect(Collectors.toMap(Env::getName, Function.identity()));
.collect(Collectors.toMap(Env::getId, Function.identity()));

for (var envIdEntry : envIds.entrySet()) {
if (!name2envsFromDb.containsKey(envIdEntry.getKey())) {
log.error("Error: Environment not found for env {}", envIdEntry.getKey());
} else {
totalTopicCount.add(
CommonUtilsService.ChartsOverviewItem.of(envIdEntry.getKey(), envIdEntry.getValue()));
CommonUtilsService.ChartsOverviewItem.of(
name2envsFromDb.get(envIdEntry.getKey()).getName(), envIdEntry.getValue()));
}
}
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,10 @@ public <X> ChartsJsOverview getChartsJsOverview(
List<String> labels = new ArrayList<>(size);
List<String> colors = new ArrayList<>(size);

data.add(0);
labels.add("");
if (activityCountList.isEmpty()) {
data.add(0);
labels.add("");
}

int totalCount = 0;

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/resources/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ <h4 class="mb-3">Shortcuts</h4>
</p>
</div>
</div>

</div>
<div class="row">
<!-- col -->

Expand Down

0 comments on commit e85763e

Please sign in to comment.