Apply clients filter to Insight's Clients section (#4240)

This commit is contained in:
Kamil Kisiela 2024-03-15 13:43:31 +01:00 committed by GitHub
parent 908dbe5f85
commit 3f668b100e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 1 deletions

View file

@ -687,10 +687,12 @@ export class OperationsManager {
project,
target,
operations,
clients,
schemaCoordinate,
}: {
period: DateRange;
operations?: readonly string[];
clients?: readonly string[];
schemaCoordinate?: string;
} & TargetSelector) {
this.logger.info('Counting unique clients (period=%o, target=%s)', period, target);
@ -705,6 +707,7 @@ export class OperationsManager {
target,
period,
operations,
clients,
schemaCoordinate,
});
}

View file

@ -796,11 +796,13 @@ export class OperationsReader {
target,
period,
operations,
clients,
schemaCoordinate,
}: {
target: string;
period: DateRange;
operations?: readonly string[];
clients?: readonly string[];
schemaCoordinate?: string;
}): Promise<
Array<{
@ -832,6 +834,7 @@ export class OperationsReader {
target,
period,
operations,
clients,
extra: schemaCoordinate
? [
sql`hash IN (SELECT hash FROM coordinates_daily ${this.createFilter({
@ -859,6 +862,7 @@ export class OperationsReader {
target,
period,
operations,
clients,
extra: schemaCoordinate
? [
sql`hash IN (SELECT hash FROM coordinates_daily ${this.createFilter({
@ -886,6 +890,7 @@ export class OperationsReader {
target,
period,
operations,
clients,
extra: schemaCoordinate
? [
sql`hash IN (SELECT hash FROM coordinates_daily ${this.createFilter({

View file

@ -433,7 +433,7 @@ export const resolvers: OperationsModule.Resolvers = {
});
},
clients(
{ organization, project, target, period, operations: operationsFilter },
{ organization, project, target, period, operations: operationsFilter, clients },
_,
{ injector },
) {
@ -443,6 +443,7 @@ export const resolvers: OperationsModule.Resolvers = {
organization,
period,
operations: operationsFilter,
clients,
});
},
duration(