Product usage metric graphs

This commit is contained in:
Oleksiy Kovyrin 2021-10-12 16:49:20 -04:00
parent c9b4e2442e
commit 548a2a562f
3 changed files with 55 additions and 4 deletions

View file

@ -23,7 +23,11 @@ import { Status } from './status';
export class EnterpriseSearchOverview extends PureComponent {
render() {
const { metrics, stats, ...props } = this.props;
const metricsToShow = [metrics.app_search_total_engines];
const productUsageMetrics = [
metrics.app_search_total_engines,
metrics.workplace_search_total_org_sources,
metrics.workplace_search_total_private_sources,
];
return (
<EuiPage>
@ -44,9 +48,18 @@ export class EnterpriseSearchOverview extends PureComponent {
<EuiSpacer size="m" />
<EuiPageContent>
<EuiScreenReaderOnly>
<h1>
<FormattedMessage
id="xpack.monitoring.entSearch.overview.productUsage"
defaultMessage="Product Usage Summary"
/>
</h1>
</EuiScreenReaderOnly>
<EuiFlexGrid columns={2} gutterSize="s">
{metricsToShow.map((metric, index) => (
{productUsageMetrics.map((metric, index) => (
<EuiFlexItem key={index}>
{/* FIXME: Figure out if we can limit the values on the graph to positive only */}
<MonitoringTimeseriesContainer series={metric} {...props} />
<EuiSpacer />
</EuiFlexItem>

View file

@ -23,7 +23,41 @@ export const metrics = {
}
),
format: SMALL_FLOAT,
units: 'engines',
units: '',
metricAgg: 'avg',
}),
workplace_search_total_org_sources: new EnterpriseSearchMetric({
field: 'enterprisesearch.stats.product_usage.workplace_search.total_org_sources',
label: i18n.translate('xpack.monitoring.metrics.entSearch.workplace_search_org_sources', {
defaultMessage: 'Workpace Search Org Sources',
}),
description: i18n.translate(
'xpack.monitoring.metrics.entSearch.workplace_search_org_sources.description',
{
defaultMessage:
'Current number of Workplace Search org-wide content sources within the Enterprise Search deployment.',
}
),
format: SMALL_FLOAT,
units: '',
metricAgg: 'avg',
}),
workplace_search_total_private_sources: new EnterpriseSearchMetric({
field: 'enterprisesearch.stats.product_usage.workplace_search.total_private_sources',
label: i18n.translate('xpack.monitoring.metrics.entSearch.workplace_search_private_sources', {
defaultMessage: 'Workpace Search Private Sources',
}),
description: i18n.translate(
'xpack.monitoring.metrics.entSearch.workplace_search_private_sources.description',
{
defaultMessage:
'Current number of Workplace Search private content sources within the Enterprise Search deployment.',
}
),
format: SMALL_FLOAT,
units: '',
metricAgg: 'avg',
}),

View file

@ -5,4 +5,8 @@
* 2.0.
*/
export const metricSet = ['app_search_total_engines'];
export const metricSet = [
'app_search_total_engines',
'workplace_search_total_org_sources',
'workplace_search_total_private_sources',
];