Skip to content

Commit

Permalink
Improvements to the test perfs API (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fgerthoffert authored Jul 19, 2022
1 parent eb8d375 commit 2682834
Show file tree
Hide file tree
Showing 8 changed files with 265 additions and 107 deletions.
211 changes: 145 additions & 66 deletions src/testingPerfs/data/data.resolvers.ts

Large diffs are not rendered by default.

50 changes: 43 additions & 7 deletions src/utils/testing/types/perf.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Field, ObjectType, ID } from '@nestjs/graphql';

import ResourceConnection from './resourceConnection';
import TagConnection from './tagConnection';
import PerfRunConnection from './perfRunConnection';
import PerfRun from './perfRun';
import Platform from './platform';
import RepositoryConnection from '../../github/types/repositoryConnection'
import RepositoryConnection from '../../github/types/repositoryConnection';

@ObjectType()
export default class Perf {
Expand All @@ -31,6 +32,18 @@ export default class Perf {
})
description: string;

@Field(() => String, {
nullable: true,
description: 'Who did the description',
})
description_by: string;

@Field(() => String, {
nullable: true,
description: 'Date the descruption was added',
})
description_date: string;

@Field(() => String, {
nullable: true,
description: 'Analysis of the run, written by a team member',
Expand All @@ -41,14 +54,32 @@ export default class Perf {
nullable: true,
description: 'Who did the analysis',
})
analysis_by: string;
analysis_by: string;

@Field(() => String, {
nullable: true,
description: 'Date the analysis was performed',
})
analysis_date: string;

@Field(() => String, {
nullable: true,
description: 'Group set by a user to allow quick filtering',
})
group: string;

@Field(() => String, {
nullable: true,
description: 'Who did set the group',
})
group_by: string;

@Field(() => String, {
nullable: true,
description: 'When was the group set',
})
group_date: string;

@Field(() => Boolean, {
nullable: true,
description: 'Was the run verified and relevant ?',
Expand All @@ -59,7 +90,7 @@ export default class Perf {
nullable: true,
description: 'Who verified therun',
})
verified_by: string;
verified_by: string;

@Field(() => String, {
nullable: true,
Expand Down Expand Up @@ -95,7 +126,7 @@ export default class Perf {
nullable: true,
description: 'Rampup used for the run',
})
rampUp: number;
rampUp: number;

@Field(() => Platform, {
nullable: false,
Expand All @@ -109,6 +140,12 @@ export default class Perf {
})
resources: ResourceConnection;

@Field(() => TagConnection, {
nullable: false,
description: 'List of tags associated with the run',
})
tags: TagConnection;

@Field(() => PerfRunConnection, {
nullable: true,
description: 'Runs executed in the tests',
Expand All @@ -119,7 +156,7 @@ export default class Perf {
nullable: false,
description: 'Run corresponding to the selected profile (provided using profileid)',
})
run: PerfRun;
run: PerfRun;

@Field(() => String, {
nullable: true,
Expand All @@ -143,6 +180,5 @@ export default class Perf {
nullable: true,
description: 'When was the run disabled',
})
disabled_date: string;

disabled_date: string;
}
6 changes: 3 additions & 3 deletions src/utils/testing/types/perfAverage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ export default class PerfAverage {
values: PerfAverageValue[];

@Field(() => [String], {
nullable: false,
nullable: true,
description: 'List of available transactions',
})
transactions: [string];
transactions: [string];

@Field(() => [String], {
nullable: false,
description: 'List of available statistics keys',
})
statisticsKeys: [string];
statisticsKeys: [string];
}
5 changes: 2 additions & 3 deletions src/utils/testing/types/perfRun.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Field, ObjectType, ID } from '@nestjs/graphql';

import Statistics from './statistics'
import Statistics from './statistics';

@ObjectType()
export default class PerfRun {
Expand Down Expand Up @@ -28,9 +28,8 @@ export default class PerfRun {
duration: number;

@Field(() => [Statistics], {
nullable: false,
nullable: true,
description: 'Statistics coming from JMeter statistics.json file',
})
statistics: Statistics[];

}
55 changes: 27 additions & 28 deletions src/utils/testing/types/statistics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,87 +3,86 @@ import { Field, ObjectType } from '@nestjs/graphql';
@ObjectType()
export default class Statistics {
@Field(() => String, {
nullable: false,
nullable: true,
description: 'Name of the transaction',
})
transaction: string;

@Field({
nullable: false,
nullable: true,
description: 'sampleCount result',
})
sampleCount: number;
sampleCount: number;

@Field({
nullable: false,
nullable: true,
description: 'errorCount result',
})
errorCount: number;
errorCount: number;

@Field({
nullable: false,
nullable: true,
description: 'errorPct result',
})
errorPct: number;
errorPct: number;

@Field({
nullable: false,
nullable: true,
description: 'meanResTime result',
})
meanResTime: number;
meanResTime: number;

@Field({
nullable: false,
nullable: true,
description: 'medianResTime result',
})
medianResTime: number;
medianResTime: number;

@Field({
nullable: false,
nullable: true,
description: 'minResTime result',
})
minResTime: number;
minResTime: number;

@Field({
nullable: false,
nullable: true,
description: 'maxResTime result',
})
maxResTime: number;
maxResTime: number;

@Field({
nullable: false,
nullable: true,
description: 'pct1ResTime result',
})
pct1ResTime: number;
pct1ResTime: number;

@Field({
nullable: false,
nullable: true,
description: 'pct2ResTime result',
})
pct2ResTime: number;
pct2ResTime: number;

@Field({
nullable: false,
nullable: true,
description: 'pct3ResTime result',
})
pct3ResTime: number;
pct3ResTime: number;

@Field({
nullable: false,
nullable: true,
description: 'throughput result',
})
throughput: number;
throughput: number;

@Field({
nullable: false,
nullable: true,
description: 'receivedKBytesPerSec result',
})
receivedKBytesPerSec: number;
receivedKBytesPerSec: number;

@Field({
nullable: false,
nullable: true,
description: 'sentKBytesPerSec result',
})
sentKBytesPerSec: number;

sentKBytesPerSec: number;
}
15 changes: 15 additions & 0 deletions src/utils/testing/types/tag.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Field, ObjectType, ID } from '@nestjs/graphql';

@ObjectType()
export default class Tag {
@Field(() => ID, {
nullable: true,
})
id: string;

@Field(() => String, {
nullable: false,
description: 'Name of the tag',
})
name: string;
}
18 changes: 18 additions & 0 deletions src/utils/testing/types/tagConnection.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Field, ObjectType, Int } from '@nestjs/graphql';

import TagEdge from './tagEdge';

@ObjectType()
export default class TagConnection {
@Field(() => [TagEdge], {
nullable: false,
description: 'A list of edges.',
})
edges: TagEdge[];

@Field(() => Int, {
nullable: false,
description: 'Identifies the total count of items in the connection.',
})
totalCount: string;
}
12 changes: 12 additions & 0 deletions src/utils/testing/types/tagEdge.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Field, ObjectType } from '@nestjs/graphql';

import Tag from './tag';

@ObjectType()
export default class TagEdge {
@Field(() => Tag, {
nullable: false,
description: 'The item at the end of the edge.',
})
node: Tag;
}

0 comments on commit 2682834

Please sign in to comment.