Skip to content

Commit b730e2c

Browse files
asier-isayasAsier Isayas
and
Asier Isayas
authored
Set default RU throughput for Production workload accounts to be 10k (#2070) (#2072)
* assign default throughput based on workload type * combined common logic * fix unit tests * add tests * update tests * npm run format * Set default RU throughput for Production workload accounts to be 10k * remove unused method * refactor --------- Co-authored-by: Asier Isayas <[email protected]>
1 parent 14c9874 commit b730e2c

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/Explorer/Controls/ThroughputInput/ThroughputInput.tsx

+12-4
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,20 @@ export const ThroughputInput: FunctionComponent<ThroughputInputProps> = ({
3535
setIsThroughputCapExceeded,
3636
onCostAcknowledgeChange,
3737
}: ThroughputInputProps) => {
38-
const defaultThroughput: number =
38+
let defaultThroughput: number;
39+
const workloadType: Constants.WorkloadType = getWorkloadType();
40+
41+
if (
3942
isFreeTier ||
4043
isQuickstart ||
41-
[Constants.WorkloadType.Learning, Constants.WorkloadType.DevelopmentTesting].includes(getWorkloadType())
42-
? AutoPilotUtils.autoPilotThroughput1K
43-
: AutoPilotUtils.autoPilotThroughput4K;
44+
[Constants.WorkloadType.Learning, Constants.WorkloadType.DevelopmentTesting].includes(workloadType)
45+
) {
46+
defaultThroughput = AutoPilotUtils.autoPilotThroughput1K;
47+
} else if (workloadType === Constants.WorkloadType.Production) {
48+
defaultThroughput = AutoPilotUtils.autoPilotThroughput10K;
49+
} else {
50+
defaultThroughput = AutoPilotUtils.autoPilotThroughput4K;
51+
}
4452

4553
const [isAutoscaleSelected, setIsAutoScaleSelected] = useState<boolean>(true);
4654
const [throughput, setThroughput] = useState<number>(defaultThroughput);

src/Utils/AutoPilotUtils.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export const autoPilotThroughput1K = 1000;
22
export const autoPilotIncrementStep = 1000;
33
export const autoPilotThroughput4K = 4000;
4+
export const autoPilotThroughput10K = 10000;
45

56
export function isValidAutoPilotThroughput(maxThroughput: number): boolean {
67
if (!maxThroughput) {

0 commit comments

Comments
 (0)