Skip to content

Commit 6cea27d

Browse files
#RI-5609 - remove functionsWithStreams tip
1 parent 462ab06 commit 6cea27d

File tree

13 files changed

+1
-223
lines changed

13 files changed

+1
-223
lines changed

redisinsight/api/src/constants/recommendations.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export const RECOMMENDATION_NAMES = Object.freeze({
2020
STRING_TO_JSON: 'stringToJson',
2121
SEARCH_VISUALIZATION: 'searchVisualization',
2222
SEARCH_HASH: 'searchHash',
23-
FUNCTIONS_WITH_STREAMS: 'functionsWithStreams',
2423
});
2524

2625
export const ONE_NODE_RECOMMENDATIONS = [

redisinsight/api/src/modules/browser/keys/keys.service.spec.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,6 @@ describe('KeysService', () => {
196196
RECOMMENDATION_NAMES.SEARCH_JSON,
197197
{ keys: result, client: mockStandaloneRedisClient, databaseId: mockBrowserClientMetadata.databaseId },
198198
);
199-
expect(recommendationService.check).toBeCalledWith(
200-
mockBrowserClientMetadata,
201-
RECOMMENDATION_NAMES.FUNCTIONS_WITH_STREAMS,
202-
{ keys: result, client: mockStandaloneRedisClient, databaseId: mockBrowserClientMetadata.databaseId },
203-
);
204199

205200
expect(recommendationService.check).toBeCalledTimes(2);
206201
});

redisinsight/api/src/modules/browser/keys/keys.service.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,6 @@ export class KeysService {
109109
RECOMMENDATION_NAMES.SEARCH_JSON,
110110
{ keys: result, client, databaseId: clientMetadata.databaseId },
111111
);
112-
this.recommendationService.check(
113-
clientMetadata,
114-
RECOMMENDATION_NAMES.FUNCTIONS_WITH_STREAMS,
115-
{ keys: result, client, databaseId: clientMetadata.databaseId },
116-
);
117112

118113
return plainToClass(GetKeyInfoResponse, result);
119114
} catch (error) {

redisinsight/api/src/modules/database-recommendation/scanner/recommendation.provider.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import {
1818
BigStringStrategy,
1919
CompressionForListStrategy,
2020
BigAmountConnectedClientsStrategy,
21-
FunctionsWithStreamsStrategy,
2221
} from 'src/modules/database-recommendation/scanner/strategies';
2322

2423
@Injectable()
@@ -44,7 +43,6 @@ export class RecommendationProvider {
4443
this.strategies.set(RECOMMENDATION_NAMES.BIG_STRINGS, new BigStringStrategy());
4544
this.strategies.set(RECOMMENDATION_NAMES.COMPRESSION_FOR_LIST, new CompressionForListStrategy());
4645
this.strategies.set(RECOMMENDATION_NAMES.BIG_AMOUNT_OF_CONNECTED_CLIENTS, new BigAmountConnectedClientsStrategy());
47-
this.strategies.set(RECOMMENDATION_NAMES.FUNCTIONS_WITH_STREAMS, new FunctionsWithStreamsStrategy(databaseService));
4846
}
4947

5048
getStrategy(type: string): IRecommendationStrategy {

redisinsight/api/src/modules/database-recommendation/scanner/strategies/functions-with-streams.strategy.spec.ts

Lines changed: 0 additions & 107 deletions
This file was deleted.

redisinsight/api/src/modules/database-recommendation/scanner/strategies/functions-with-streams.strategy.ts

Lines changed: 0 additions & 42 deletions
This file was deleted.

redisinsight/api/src/modules/database-recommendation/scanner/strategies/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,3 @@ export * from './avoid-lua-scripts.strategy';
1313
export * from './big-string.strategy';
1414
export * from './compression-for-list.strategy';
1515
export * from './big-amount-connected-clients.strategy';
16-
export * from './functions-with-streams.strategy';

redisinsight/api/src/modules/recommendation/providers/recommendation.provider.spec.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -671,12 +671,6 @@ describe('RecommendationProvider', () => {
671671
expect(functionsWithStreamsRecommendation).toEqual(null);
672672
});
673673

674-
it('should return functionsWithStreams recommendation when there is stream key', async () => {
675-
const functionsWithStreamsRecommendation = await service
676-
.determineFunctionsWithStreamsRecommendation([mockStreamKey], mockTfunctionListResponse1);
677-
expect(functionsWithStreamsRecommendation).toEqual({ name: RECOMMENDATION_NAMES.FUNCTIONS_WITH_STREAMS });
678-
});
679-
680674
it('should return null when there is no stream key', async () => {
681675
const functionsWithStreamsRecommendation = await service
682676
.determineFunctionsWithStreamsRecommendation([mockSmallStringKey], mockTfunctionListResponse1);

redisinsight/api/src/modules/recommendation/providers/recommendation.provider.ts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -544,30 +544,4 @@ export class RecommendationProvider {
544544
return null;
545545
}
546546
}
547-
548-
/**
549-
* Check functionsWithStreams recommendation
550-
* @param keys
551-
* @param libraries
552-
*/
553-
554-
async determineFunctionsWithStreamsRecommendation(
555-
keys: Key[],
556-
libraries?: string[],
557-
): Promise<Recommendation> {
558-
if (libraries?.length) {
559-
return null;
560-
}
561-
562-
try {
563-
const isStreamKey = keys.some((key) => key.type === RedisDataType.Stream);
564-
565-
return isStreamKey
566-
? { name: RECOMMENDATION_NAMES.FUNCTIONS_WITH_STREAMS }
567-
: null;
568-
} catch (err) {
569-
this.logger.error('Can not determine functions with streams recommendation', err);
570-
return null;
571-
}
572-
}
573547
}

redisinsight/api/src/modules/recommendation/recommendation.service.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,6 @@ export class RecommendationService {
116116
RECOMMENDATION_NAMES.SEARCH_HASH,
117117
async () => await this.recommendationProvider.determineSearchHashRecommendation(keys, indexes),
118118
],
119-
[
120-
RECOMMENDATION_NAMES.FUNCTIONS_WITH_STREAMS,
121-
async () => await this.recommendationProvider
122-
.determineFunctionsWithStreamsRecommendation(keys, libraries),
123-
],
124119
// it is live time recommendation (will add later)
125120
[
126121
RECOMMENDATION_NAMES.STRING_TO_JSON,

0 commit comments

Comments
 (0)