Skip to content

Commit

Permalink
[Enterprise Search] Render indexed_document_volume in MiB (#155250)
Browse files Browse the repository at this point in the history
## Part of elastic/connectors#735

## Summary

The field type for `indexed_document_volume` is `integer`, which can
only represent about 2GB worth of "bytes". To be able to support syncing
with larger datasets, `indexed_document_volume` is updated to store the
size in `MebiBytes`.

This PR makes sure the size is rendered correctly in UI.

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
  • Loading branch information
wangch079 authored Apr 20, 2023
1 parent 1172130 commit 5de52e8
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,23 @@ export const SyncJobDocumentsPanel: React.FC<SyncJobDocumentsPanelProps> = (sync
name: i18n.translate('xpack.enterpriseSearch.content.index.syncJobs.documents.volume', {
defaultMessage: 'Volume',
}),
render: (volume: number) => new ByteSizeValue(volume).toString(),
render: (volume: number) =>
volume < 1
? i18n.translate(
'xpack.enterpriseSearch.content.index.syncJobs.documents.volume.lessThanOneMBLabel',
{
defaultMessage: 'Less than 1mb',
}
)
: i18n.translate(
'xpack.enterpriseSearch.content.index.syncJobs.documents.volume.aboutLabel',
{
defaultMessage: 'About {volume}',
values: {
volume: new ByteSizeValue(volume * 1024 * 1024).toString(),
},
}
),
},
];
return (
Expand Down

0 comments on commit 5de52e8

Please sign in to comment.