[APM] Java metrics follow-up fixes (#37337)

* [APM] Closes #69301 by adding CPU/Memory graphs back to java-specific
metrics, modifying java metrics chart labels, and adding thread count
max line to chart.

* [APM] update i18n unused translation

* [APM] add filter to exclude non-existent memory chart data
This commit is contained in:
Oliver Gupte 2019-05-30 17:04:24 -07:00 committed by GitHub
parent 1ea3431c69
commit 182c329c7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 34 additions and 19 deletions

View file

@ -25,7 +25,7 @@ const chartBase: ChartBase<HeapMemoryMetrics> = {
title: i18n.translate(
'xpack.apm.agentMetrics.java.heapMemorySeriesUsed',
{
defaultMessage: 'Used'
defaultMessage: 'Avg. used'
}
),
color: theme.euiColorVis0
@ -34,18 +34,15 @@ const chartBase: ChartBase<HeapMemoryMetrics> = {
title: i18n.translate(
'xpack.apm.agentMetrics.java.heapMemorySeriesCommitted',
{
defaultMessage: 'Committed'
defaultMessage: 'Avg. committed'
}
),
color: theme.euiColorVis1
},
heapMemoryMax: {
title: i18n.translate(
'xpack.apm.agentMetrics.java.nonHeapMemorySeriesMax',
{
defaultMessage: 'Max'
}
),
title: i18n.translate('xpack.apm.agentMetrics.java.heapMemorySeriesMax', {
defaultMessage: 'Avg. limit'
}),
color: theme.euiColorVis2
}
}

View file

@ -8,9 +8,13 @@ import { getHeapMemoryChart } from './heap_memory';
import { Setup } from '../../../helpers/setup_request';
import { getNonHeapMemoryChart } from './non_heap_memory';
import { getThreadCountChart } from './thread_count';
import { getCPUChartData } from '../shared/cpu';
import { getMemoryChartData } from '../shared/memory';
export async function getJavaMetricsCharts(setup: Setup, serviceName: string) {
const charts = await Promise.all([
getCPUChartData(setup, serviceName),
getMemoryChartData(setup, serviceName),
getHeapMemoryChart(setup, serviceName),
getNonHeapMemoryChart(setup, serviceName),
getThreadCountChart(setup, serviceName)

View file

@ -23,7 +23,7 @@ const chartBase: ChartBase<NonHeapMemoryMetrics> = {
title: i18n.translate(
'xpack.apm.agentMetrics.java.nonHeapMemorySeriesUsed',
{
defaultMessage: 'Used'
defaultMessage: 'Avg. used'
}
),
color: theme.euiColorVis0
@ -32,7 +32,7 @@ const chartBase: ChartBase<NonHeapMemoryMetrics> = {
title: i18n.translate(
'xpack.apm.agentMetrics.java.nonHeapMemorySeriesCommitted',
{
defaultMessage: 'Committed'
defaultMessage: 'Avg. committed'
}
),
color: theme.euiColorVis1

View file

@ -22,7 +22,8 @@ export async function fetch(setup: Setup, serviceName: string) {
const { start, end, uiFiltersES, client, config } = setup;
const aggs = {
threadCount: { avg: { field: METRIC_JAVA_THREAD_COUNT } }
threadCount: { avg: { field: METRIC_JAVA_THREAD_COUNT } },
threadCountMax: { max: { field: METRIC_JAVA_THREAD_COUNT } }
};
const params = {
@ -35,9 +36,7 @@ export async function fetch(setup: Setup, serviceName: string) {
{ term: { [SERVICE_NAME]: serviceName } },
{ term: { [PROCESSOR_EVENT]: 'metric' } },
{ term: { [SERVICE_AGENT_NAME]: 'java' } },
{
range: rangeFilter(start, end)
},
{ range: rangeFilter(start, end) },
...uiFiltersES
]
}

View file

@ -21,9 +21,15 @@ const chartBase: ChartBase<ThreadCountMetrics> = {
series: {
threadCount: {
title: i18n.translate('xpack.apm.agentMetrics.java.threadCount', {
defaultMessage: 'Count'
defaultMessage: 'Avg. count'
}),
color: theme.euiColorVis0
},
threadCountMax: {
title: i18n.translate('xpack.apm.agentMetrics.java.threadCountMax', {
defaultMessage: 'Max count'
}),
color: theme.euiColorVis1
}
}
};

View file

@ -45,6 +45,16 @@ export async function fetch(setup: Setup, serviceName: string) {
{
range: rangeFilter(start, end)
},
{
exists: {
field: METRIC_SYSTEM_FREE_MEMORY
}
},
{
exists: {
field: METRIC_SYSTEM_TOTAL_MEMORY
}
},
...uiFiltersES
]
}

View file

@ -14,7 +14,7 @@ const chartBase: ChartBase<MemoryMetrics> = {
title: i18n.translate(
'xpack.apm.serviceDetails.metrics.memoryUsageChartTitle',
{
defaultMessage: 'Memory usage'
defaultMessage: 'System memory usage'
}
),
key: 'memory_usage_chart',
@ -23,12 +23,12 @@ const chartBase: ChartBase<MemoryMetrics> = {
series: {
memoryUsedMax: {
title: i18n.translate('xpack.apm.chart.memorySeries.systemMaxLabel', {
defaultMessage: 'System max'
defaultMessage: 'Max'
})
},
memoryUsedAvg: {
title: i18n.translate('xpack.apm.chart.memorySeries.systemAverageLabel', {
defaultMessage: 'System average'
defaultMessage: 'Average'
})
}
}

View file

@ -3626,7 +3626,6 @@
"xpack.apm.agentMetrics.java.heapMemorySeriesUsed": "使用中",
"xpack.apm.agentMetrics.java.nonHeapMemoryChartTitle": "ヒープ領域以外",
"xpack.apm.agentMetrics.java.nonHeapMemorySeriesCommitted": "割当",
"xpack.apm.agentMetrics.java.nonHeapMemorySeriesMax": "最高",
"xpack.apm.agentMetrics.java.nonHeapMemorySeriesUsed": "使用中",
"xpack.apm.agentMetrics.java.threadCount": "カウント",
"xpack.apm.agentMetrics.java.threadCountChartTitle": "スレッド数",