Skip to content

Commit

Permalink
feat: add stress method
Browse files Browse the repository at this point in the history
1. stress start: start stress test  ; 2. stress clean: clean the relevant resources
  • Loading branch information
SquatsTonight committed Jun 18, 2021
1 parent b6c2ca8 commit da4d442
Show file tree
Hide file tree
Showing 20 changed files with 939 additions and 13 deletions.
1 change: 1 addition & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ export default class FcBaseComponent {
logs(inputs: IInputs): Promise<any>;
metrics(inputs: IInputs): Promise<any>;
nas(inputs: IInputs): Promise<void>;
stress(inputs: IInputs): Promise<any>;
help(inputs: IInputs): Promise<void>;
}
94 changes: 93 additions & 1 deletion dist/index.js

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions dist/lib/component/fc-stress.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { HttpTypeOption, EventTypeOption, StressOption, PayloadOption } from '../interface/component/fs-stress';
export default class FcStress {
private readonly httpTypeOpts?;
private readonly eventTypeOpts?;
private readonly stressOpts?;
private readonly payloadOpts?;
private readonly region;
private readonly access;
constructor(access: string, region: string, stressOpts?: StressOption, httpTypeOpts?: HttpTypeOption, eventTypeOpts?: EventTypeOption, payloadOpts?: PayloadOption);
private isEventFunctionType;
private isHttpFunctionType;
makeStartArgs(): string;
makeCleanArgs(assumeYes?: boolean): string;
}
59 changes: 59 additions & 0 deletions dist/lib/component/fc-stress.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions dist/lib/interface/component/fs-stress.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export interface StressOption {
numUser?: number;
spawnRate?: number;
runningTime?: number;
functionType: string;
}
export interface HttpTypeOption {
url: number;
method?: string;
body?: any;
}
export interface EventTypeOption {
serviceName: string;
functionName: string;
qualifier?: string;
payload?: any;
}
export interface PayloadOption {
payload?: string;
payloadFile?: string;
}
3 changes: 3 additions & 0 deletions dist/lib/interface/component/fs-stress.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion dist/lib/interface/interface.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import { ServerlessProfile } from './profile';
export interface IInputs extends ServerlessProfile {
props: IProperties;
args: string;
path: string;
path: {
configPath: string;
};
command: string;
}
export interface IProperties {
region: string;
Expand Down
84 changes: 84 additions & 0 deletions dist/lib/static.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,3 +349,87 @@ export declare const BUILD_HELP_INFO: ({
}[];
content?: undefined;
})[];
export declare const STRESS_HTLP_INFO: ({
header: string;
content: string;
} | {
header: string;
content: {
name: string;
summary: string;
}[];
})[];
export declare const STRESS_SUB_COMMAND_HELP_INFO: {
start: ({
header: string;
content: string;
optionList?: undefined;
} | {
header: string;
optionList: ({
name: string;
typeLabel: string;
description: string;
type: NumberConstructor;
alias?: undefined;
} | {
name: string;
typeLabel: string;
description: string;
type: StringConstructor;
alias?: undefined;
} | {
name: string;
typeLabel: string;
description: string;
alias: string;
type: StringConstructor;
})[];
content?: undefined;
} | {
header: string;
optionList: ({
name: string;
typeLabel: string;
description: string;
alias: string;
type: StringConstructor;
} | {
name: string;
description: string;
alias: string;
type: BooleanConstructor;
typeLabel?: undefined;
})[];
content?: undefined;
} | {
header: string;
content: string[];
optionList?: undefined;
})[];
clean: ({
header: string;
content: string;
optionList?: undefined;
} | {
header: string;
optionList: ({
name: string;
typeLabel: string;
description: string;
alias: string;
type: StringConstructor;
} | {
name: string;
description: string;
alias: string;
type: BooleanConstructor;
typeLabel?: undefined;
})[];
content?: undefined;
} | {
header: string;
content: string[];
optionList?: undefined;
})[];
};
Loading

0 comments on commit da4d442

Please sign in to comment.