]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: updating SMB rate limiting form fields 69830/head
authorDevika Babrekar <devika.babrekar@ibm.com>
Tue, 30 Jun 2026 10:03:13 +0000 (15:33 +0530)
committerDevika Babrekar <devika.babrekar@ibm.com>
Fri, 17 Jul 2026 11:35:53 +0000 (17:05 +0530)
Fixes: https://tracker.ceph.com/issues/77815
Signed-off-by: Devika Babrekar <devika.babrekar@ibm.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-share-form/smb-share-form.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-share-form/smb-share-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-share-form/smb-share-form.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb.model.ts

index 7340f26ffd188b2a91dbe2cd3376bc097a474595..d554b765437318d60791e23ba5843fcf38e9623b 100644 (file)
       >
         <div cdsCol>
           <cds-number
-            formControlName="read_delay_max"
+            formControlName="read_burst_mult"
             cdValidate
-            #readDelayRef="cdValidate"
-            label="Read delay max (s)"
+            #readBurstRef="cdValidate"
+            label="Read burst mult"
             i18n-label
-            [min]="0"
-            [max]="300"
-            helperText="Max allowed delay for read operations in seconds"
+            [min]="10"
+            [max]="100"
+            helperText="Burst multiplier for read operations, allowing temporary bursts above the configured limit."
             i18n-helperText
-            [invalid]="readDelayRef.isInvalid"
-            invalidText="Value must be between 0 and 300"
+            [invalid]="readBurstRef.isInvalid"
+            invalidText="Value must be between 10 and 100"
             i18n-invalidText
           >
           </cds-number>
         </div>
         <div cdsCol>
           <cds-number
-            formControlName="write_delay_max"
+            formControlName="write_burst_mult"
             cdValidate
-            #writeDelayRef="cdValidate"
-            label="Write delay max (s)"
+            #writeBurstRef="cdValidate"
+            label="Write burst mult"
             i18n-label
-            [min]="0"
-            [max]="300"
-            helperText="Max allowed delay for write operations in seconds"
+            [min]="10"
+            [max]="100"
+            helperText="Burst multiplier for write operations, allowing temporary bursts above the configured limit."
             i18n-helperText
-            [invalid]="writeDelayRef.isInvalid"
-            invalidText="Value must be between 0 and 300"
+            [invalid]="writeBurstRef.isInvalid"
+            invalidText="Value must be between 10 and 100"
             i18n-invalidText
           >
           </cds-number>
index a1300f298e79d355c51d3d83e4d322572b4717a0..1b9be7394092916d79b1d3ea65996c15bff969ac 100644 (file)
@@ -42,6 +42,7 @@ describe('SmbShareFormComponent', () => {
 
     fixture = TestBed.createComponent(SmbShareFormComponent);
     component = fixture.componentInstance;
+    component.ngOnInit();
     fixture.detectChanges();
   });
 
@@ -50,7 +51,6 @@ describe('SmbShareFormComponent', () => {
   });
 
   it('should create the form', () => {
-    component.ngOnInit();
     expect(component.smbShareForm).toBeDefined();
     expect(component.smbShareForm.get('share_id')).toBeTruthy();
     expect(component.smbShareForm.get('volume')).toBeTruthy();
@@ -97,8 +97,8 @@ describe('SmbShareFormComponent', () => {
       read_bw_limit_unit: 'MiB',
       write_bw_limit: 0,
       write_bw_limit_unit: 'MiB',
-      read_delay_max: 30,
-      write_delay_max: 30
+      read_burst_mult: 15,
+      write_burst_mult: 15
     });
     component.submitAction();
     expect(component).toBeTruthy();
@@ -106,17 +106,16 @@ describe('SmbShareFormComponent', () => {
 
   describe('QoS', () => {
     it('should have QoS form controls with default values', () => {
-      component.ngOnInit();
       expect(component.smbShareForm.get('read_iops_limit')).toBeTruthy();
       expect(component.smbShareForm.get('write_iops_limit')).toBeTruthy();
       expect(component.smbShareForm.get('read_bw_limit')).toBeTruthy();
       expect(component.smbShareForm.get('read_bw_limit_unit')).toBeTruthy();
       expect(component.smbShareForm.get('write_bw_limit')).toBeTruthy();
       expect(component.smbShareForm.get('write_bw_limit_unit')).toBeTruthy();
-      expect(component.smbShareForm.get('read_delay_max')).toBeTruthy();
-      expect(component.smbShareForm.get('write_delay_max')).toBeTruthy();
+      expect(component.smbShareForm.get('read_burst_mult')).toBeTruthy();
+      expect(component.smbShareForm.get('write_burst_mult')).toBeTruthy();
       expect(component.smbShareForm.get('read_iops_limit').value).toBe(0);
-      expect(component.smbShareForm.get('write_delay_max').value).toBe(30);
+      expect(component.smbShareForm.get('write_burst_mult').value).toBe(15);
     });
 
     it('should include QoS fields in buildRequest when set', () => {
@@ -130,13 +129,13 @@ describe('SmbShareFormComponent', () => {
         write_iops_limit: 500,
         read_bw_limit: 100,
         read_bw_limit_unit: 'MiB',
-        write_delay_max: 60
+        write_burst_mult: 60
       });
       const request = component.buildRequest();
       expect(request.share_resource.cephfs.qos.read_iops_limit).toBe(1000);
       expect(request.share_resource.cephfs.qos.write_iops_limit).toBe(500);
       expect(request.share_resource.cephfs.qos.read_bw_limit).toBe(100 * 1024 * 1024);
-      expect(request.share_resource.cephfs.qos.write_delay_max).toBe(60);
+      expect(request.share_resource.cephfs.qos.write_burst_mult).toBe(60);
     });
   });
 });
index 54aa17af23e3b52e9b2d7a80e69110643abbd4fa..f51566a4caa6766b6e5bbea046fd5289bc6a8aa4 100644 (file)
@@ -33,8 +33,9 @@ const UNIT_TO_BYTES: Record<string, number> = {
   GiB: 2 ** 30,
   TiB: 2 ** 40
 };
-const QOS_DELAY_MAX = 300;
-const QOS_DELAY_DEFAULT = 30;
+const QOS_BURST_MULT_MIN = 10;
+const QOS_BURST_MULT_MAX = 100;
+const QOS_BURST_MULT_DEFAULT = 15;
 const QOS_BW_UNITS = ['KiB', 'MiB', 'GiB', 'TiB'];
 
 function getBwMaxForUnit(unit: string): number {
@@ -106,8 +107,8 @@ export class SmbShareFormComponent extends CdForm implements OnInit {
           browseable: this.shareResponse.browseable ?? true,
           read_iops_limit: qos?.read_iops_limit,
           write_iops_limit: qos?.write_iops_limit,
-          read_delay_max: qos?.read_delay_max,
-          write_delay_max: qos?.write_delay_max
+          read_burst_mult: qos?.read_burst_mult,
+          write_burst_mult: qos?.write_burst_mult
         });
         this.smbShareForm.get('share_id').disable();
         this.smbShareForm.get('name').disable();
@@ -167,13 +168,13 @@ export class SmbShareFormComponent extends CdForm implements OnInit {
       read_bw_limit_unit: new FormControl(QOS_BW_UNITS[1]),
       write_bw_limit: new FormControl(0, [Validators.min(0), Validators.max(this.writeBwMax)]),
       write_bw_limit_unit: new FormControl(QOS_BW_UNITS[1]),
-      read_delay_max: new FormControl(QOS_DELAY_DEFAULT, [
-        Validators.min(0),
-        Validators.max(QOS_DELAY_MAX)
+      read_burst_mult: new FormControl(QOS_BURST_MULT_DEFAULT, [
+        Validators.min(QOS_BURST_MULT_MIN),
+        Validators.max(QOS_BURST_MULT_MAX)
       ]),
-      write_delay_max: new FormControl(QOS_DELAY_DEFAULT, [
-        Validators.min(0),
-        Validators.max(QOS_DELAY_MAX)
+      write_burst_mult: new FormControl(QOS_BURST_MULT_DEFAULT, [
+        Validators.min(QOS_BURST_MULT_MIN),
+        Validators.max(QOS_BURST_MULT_MAX)
       ])
     });
   }
@@ -298,8 +299,8 @@ export class SmbShareFormComponent extends CdForm implements OnInit {
                 ' ' +
                 this.smbShareForm.get('write_bw_limit_unit').value
             ),
-            read_delay_max: rawFormValue.read_delay_max,
-            write_delay_max: rawFormValue.write_delay_max
+            read_burst_mult: rawFormValue.read_burst_mult,
+            write_burst_mult: rawFormValue.write_burst_mult
           }
         },
         browseable: rawFormValue.browseable,
index 0a0e70558648a63f4ccf210b121799dccb0e7e6e..b2689bff7ec606808560450dcdeb9ab6d17d6edc 100644 (file)
@@ -83,8 +83,8 @@ export interface SMBShareQoS {
   write_iops_limit?: number;
   read_bw_limit?: number;
   write_bw_limit?: number;
-  read_delay_max?: number;
-  write_delay_max?: number;
+  read_burst_mult?: number;
+  write_burst_mult?: number;
 }
 
 export interface SMBShare {