Skip to content

Commit 839e14b

Browse files
committed
update to handle 'warning' in profile data return
1 parent 3f65936 commit 839e14b

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

packages/search/lib/commands/PROFILE_AGGREGATE.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe('PROFILE AGGREGATE', () => {
2929
});
3030
});
3131

32-
testUtils.testWithClient('client.ft.search', async client => {
32+
testUtils.testWithClient('client.ft.search', async client => {1
3333
await Promise.all([
3434
client.ft.create('index', {
3535
field: SCHEMA_FIELD_TYPE.NUMERIC
@@ -39,6 +39,7 @@ describe('PROFILE AGGREGATE', () => {
3939
]);
4040

4141
const res = await client.ft.profileAggregate('index', '*');
42+
assert.deepEqual('None', res.profile.warning);
4243
assert.ok(typeof res.profile.iteratorsProfile.counter === 'number');
4344
assert.ok(typeof res.profile.parsingTime === 'string');
4445
assert.ok(res.results.total == 1);

packages/search/lib/commands/PROFILE_SEARCH.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ describe('PROFILE SEARCH', () => {
3535
]);
3636

3737
const res = await client.ft.profileSearch('index', '*');
38+
assert.strictEqual('None', res.profile.warning);
3839
assert.ok(typeof res.profile.iteratorsProfile.counter === 'number');
3940
assert.ok(typeof res.profile.parsingTime === 'string');
4041
assert.ok(res.results.total == 1);

packages/search/lib/commands/PROFILE_SEARCH.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ interface ProfileData {
8282
totalProfileTime: string,
8383
parsingTime: string,
8484
pipelineCreationTime: string,
85+
warning: string,
8586
iteratorsProfile: IteratorsProfile
8687
}
8788

@@ -90,7 +91,8 @@ export function transformProfile(reply: Array<any>): ProfileData{
9091
totalProfileTime: reply[0][1],
9192
parsingTime: reply[1][1],
9293
pipelineCreationTime: reply[2][1],
93-
iteratorsProfile: transformIterators(reply[3][1])
94+
warning: reply[3][1] ? reply[3][1] : 'None',
95+
iteratorsProfile: transformIterators(reply[4][1])
9496
};
9597
}
9698

0 commit comments

Comments
 (0)