mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-03-27 12:10:09 +00:00
Set default RU throughput for Production workload accounts to be 10k (#2070)
* 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 <aisayas@microsoft.com>
This commit is contained in:
parent
1529303107
commit
b5d7423849
@ -35,12 +35,20 @@ export const ThroughputInput: FunctionComponent<ThroughputInputProps> = ({
|
|||||||
setIsThroughputCapExceeded,
|
setIsThroughputCapExceeded,
|
||||||
onCostAcknowledgeChange,
|
onCostAcknowledgeChange,
|
||||||
}: ThroughputInputProps) => {
|
}: ThroughputInputProps) => {
|
||||||
const defaultThroughput: number =
|
let defaultThroughput: number;
|
||||||
|
const workloadType: Constants.WorkloadType = getWorkloadType();
|
||||||
|
|
||||||
|
if (
|
||||||
isFreeTier ||
|
isFreeTier ||
|
||||||
isQuickstart ||
|
isQuickstart ||
|
||||||
[Constants.WorkloadType.Learning, Constants.WorkloadType.DevelopmentTesting].includes(getWorkloadType())
|
[Constants.WorkloadType.Learning, Constants.WorkloadType.DevelopmentTesting].includes(workloadType)
|
||||||
? AutoPilotUtils.autoPilotThroughput1K
|
) {
|
||||||
: AutoPilotUtils.autoPilotThroughput4K;
|
defaultThroughput = AutoPilotUtils.autoPilotThroughput1K;
|
||||||
|
} else if (workloadType === Constants.WorkloadType.Production) {
|
||||||
|
defaultThroughput = AutoPilotUtils.autoPilotThroughput10K;
|
||||||
|
} else {
|
||||||
|
defaultThroughput = AutoPilotUtils.autoPilotThroughput4K;
|
||||||
|
}
|
||||||
|
|
||||||
const [isAutoscaleSelected, setIsAutoScaleSelected] = useState<boolean>(true);
|
const [isAutoscaleSelected, setIsAutoScaleSelected] = useState<boolean>(true);
|
||||||
const [throughput, setThroughput] = useState<number>(defaultThroughput);
|
const [throughput, setThroughput] = useState<number>(defaultThroughput);
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
export const autoPilotThroughput1K = 1000;
|
export const autoPilotThroughput1K = 1000;
|
||||||
export const autoPilotIncrementStep = 1000;
|
export const autoPilotIncrementStep = 1000;
|
||||||
export const autoPilotThroughput4K = 4000;
|
export const autoPilotThroughput4K = 4000;
|
||||||
|
export const autoPilotThroughput10K = 10000;
|
||||||
|
|
||||||
export function isValidAutoPilotThroughput(maxThroughput: number): boolean {
|
export function isValidAutoPilotThroughput(maxThroughput: number): boolean {
|
||||||
if (!maxThroughput) {
|
if (!maxThroughput) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user