From 8800f11f66e834e372ce943aaf42902181a45dbe Mon Sep 17 00:00:00 2001 From: Desi Borisova <158429017+DesiBorisova@users.noreply.github.com> Date: Mon, 4 Nov 2024 14:06:57 +0200 Subject: [PATCH] GDB-11166 - add correct label in off-heap monitoring chart (#1681) --- src/i18n/locale-en.json | 1 + src/i18n/locale-fr.json | 1 + .../chart-models/resource/non-heap-memory-chart.js | 10 ++++++++++ test-cypress/fixtures/locale-en.json | 1 + 4 files changed, 13 insertions(+) diff --git a/src/i18n/locale-en.json b/src/i18n/locale-en.json index d9d69bee7..f9174813f 100644 --- a/src/i18n/locale-en.json +++ b/src/i18n/locale-en.json @@ -1093,6 +1093,7 @@ "resource.memory.heap.label": "Heap memory usage", "resource.memory.heap.tooltip": "Shows the heap memory used by GraphDB. The heap memory is the main memory allocated for keeping the database running and it is also used for any memory-intensive operations when needed. Approaching the maximum heap size can slow down GraphDB", "resource.memory.heap.max": "Maximum heap size: ", + "resource.memory.non_heap.max": "Maximum off-heap size: ", "resource.memory.non_heap.label": "Off-heap memory usage", "resource.memory.non_heap.tooltip": "Shows the off-heap memory used by GraphDB. The off-heap memory is used only for certain structures and should not grow substantially with time", "resource.memory.committed": "Committed memory", diff --git a/src/i18n/locale-fr.json b/src/i18n/locale-fr.json index 1cf7b1ffa..dedde2a0e 100644 --- a/src/i18n/locale-fr.json +++ b/src/i18n/locale-fr.json @@ -1093,6 +1093,7 @@ "resource.memory.heap.label": "Utilisation de la mémoire du tas", "resource.memory.heap.tooltip": "Montre la mémoire du tas utilisée par GraphDB. La mémoire du tas est la mémoire principale allouée pour faire fonctionner la base de données et elle est également utilisée pour toutes les opérations gourmandes en mémoire lorsque cela est nécessaire. L'approche de la taille maximale du tas peut ralentir GraphDB", "resource.memory.heap.max": "Taille maximale du tas : ", + "resource.memory.non_heap.max": "Taille maximale hors-heap : ", "resource.memory.non_heap.label": "Utilisation de la mémoire hors-heap", "resource.memory.non_heap.tooltip": "Montre la mémoire hors-heap utilisée par GraphDB. La mémoire off-heap n'est utilisée que pour certaines structures et ne devrait pas augmenter de façon substantielle avec le temps", "resource.memory.committed": "La mémoire engagée", diff --git a/src/js/angular/resources/chart-models/resource/non-heap-memory-chart.js b/src/js/angular/resources/chart-models/resource/non-heap-memory-chart.js index 0d21e05f0..86d59bffe 100644 --- a/src/js/angular/resources/chart-models/resource/non-heap-memory-chart.js +++ b/src/js/angular/resources/chart-models/resource/non-heap-memory-chart.js @@ -5,6 +5,16 @@ export class NonHeapMemoryChart extends HeapMemoryChart { super(translateService, false, false); } + configureSubtitle(isNonHeapChart) { + if (this.latestData.max > 0) { + const subTitleKeyValues = [{ + label: this.translateService.instant('resource.memory.non_heap.max'), + value: HeapMemoryChart.formatBytesValue(this.latestData.max, null, this.selectedSeries) + }]; + this.setSubTitle(subTitleKeyValues); + } + } + parseData(data) { return data.nonHeapMemoryUsage; } diff --git a/test-cypress/fixtures/locale-en.json b/test-cypress/fixtures/locale-en.json index d9d69bee7..f9174813f 100644 --- a/test-cypress/fixtures/locale-en.json +++ b/test-cypress/fixtures/locale-en.json @@ -1093,6 +1093,7 @@ "resource.memory.heap.label": "Heap memory usage", "resource.memory.heap.tooltip": "Shows the heap memory used by GraphDB. The heap memory is the main memory allocated for keeping the database running and it is also used for any memory-intensive operations when needed. Approaching the maximum heap size can slow down GraphDB", "resource.memory.heap.max": "Maximum heap size: ", + "resource.memory.non_heap.max": "Maximum off-heap size: ", "resource.memory.non_heap.label": "Off-heap memory usage", "resource.memory.non_heap.tooltip": "Shows the off-heap memory used by GraphDB. The off-heap memory is used only for certain structures and should not grow substantially with time", "resource.memory.committed": "Committed memory",