Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add cache evict status #835

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/console/src/components/Executions/CacheStatus.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { SvgIconProps, Tooltip, Typography } from '@material-ui/core';
import { makeStyles, Theme } from '@material-ui/core/styles';
import CachedOutlined from '@material-ui/icons/CachedOutlined';
import DeleteOutlinedIcon from '@material-ui/icons/DeleteOutlined';
import ErrorOutlined from '@material-ui/icons/ErrorOutlined';
import InfoOutlined from '@material-ui/icons/InfoOutlined';
import SmsFailedOutlinedIcon from '@material-ui/icons/SmsFailedOutlined';
Expand Down Expand Up @@ -50,6 +51,11 @@ const NodeExecutionCacheStatusIcon: React.ComponentType<
case CatalogCacheStatus.CACHE_HIT: {
return <CachedOutlined {...props} ref={ref} data-testid="cache-icon" />;
}
case CatalogCacheStatus.CACHE_EVICTED: {
return (
<DeleteOutlinedIcon {...props} ref={ref} data-testid="cache-icon" />
);
}
case CatalogCacheStatus.CACHE_POPULATED: {
return (
<PublishedWithChangesOutlined
Expand Down
1 change: 1 addition & 0 deletions packages/console/src/components/Executions/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ export const cacheStatusMessages: { [k in CatalogCacheStatus]: string } = {
[CatalogCacheStatus.CACHE_PUT_FAILURE]: t('cachePutFailure'),
[CatalogCacheStatus.MAP_CACHE]: t('mapCacheMessage'),
[CatalogCacheStatus.CACHE_SKIPPED]: t('cacheSkippedMessage'),
[CatalogCacheStatus.CACHE_EVICTED]: t('cacheEvictedMessage'),
};
export const unknownCacheStatusString = t('unknownCacheStatusString');
export const viewSourceExecutionString = t('viewSourceExecutionString');
1 change: 1 addition & 0 deletions packages/console/src/components/Executions/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const str = {
unknown: 'Unknown',
cacheDisabledMessage: 'Caching was disabled for this execution.',
cacheHitMessage: 'Output for this execution was read from cache.',
cacheEvictedMessage: 'Output for this execution was evicted from cache.',
cacheLookupFailureMessage: 'Failed to lookup cache information.',
cacheMissMessage: 'No cached output was found for this execution.',
cachePopulatedMessage: 'The result of this execution was written to cache.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ describe('Executions > CacheStatus', () => {
${CatalogCacheStatus.CACHE_MISS} | ${cacheStatusMessages[CatalogCacheStatus.CACHE_MISS]}
${CatalogCacheStatus.CACHE_POPULATED} | ${cacheStatusMessages[CatalogCacheStatus.CACHE_POPULATED]}
${CatalogCacheStatus.CACHE_PUT_FAILURE} | ${cacheStatusMessages[CatalogCacheStatus.CACHE_PUT_FAILURE]}
${CatalogCacheStatus.CACHE_EVICTED} | ${cacheStatusMessages[CatalogCacheStatus.CACHE_EVICTED]}
`('for each case', ({ cacheStatus, expected }) => {
it(`renders correct text ${expected} for status ${cacheStatus}`, async () => {
const { queryByText } = renderComponent({ cacheStatus });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const CACHE_STATUSES = [
{ status: CatalogCacheStatus.CACHE_MISS, text: 'cache miss' },
{ status: CatalogCacheStatus.CACHE_POPULATED, text: 'cache populated' },
{ status: CatalogCacheStatus.CACHE_PUT_FAILURE, text: 'cache put failure' },
{ status: CatalogCacheStatus.CACHE_EVICTED, text: 'cache evicted' },
];

stories.add('Task Node by Cache Status', () => (
Expand Down
Loading