Skip to content

Commit

Permalink
feat: add cache evict status
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Dittamo <pvdittamo@gmail.com>
  • Loading branch information
pvditt committed Jan 22, 2024
1 parent cfc38e4 commit 674ca18
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 0 deletions.
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

0 comments on commit 674ca18

Please sign in to comment.