Skip to content

Commit

Permalink
default to gb unit and 20 gigs
Browse files Browse the repository at this point in the history
  • Loading branch information
Amogh-Bharadwaj committed Mar 4, 2024
1 parent 8a89ae9 commit 61f33a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions ui/app/alert-config/new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface AlertConfigProps {
serviceType: string;
authToken: string;
channelIdString: string;
slotLagMBAlertThreshold: number;
slotLagGBAlertThreshold: number;
openConnectionsAlertThreshold: number;
forEdit?: boolean;
}
Expand All @@ -38,8 +38,8 @@ const NewAlertConfig = (alertProps: AlertConfigProps) => {
const [channelIdString, setChannelIdString] = useState<string>(
alertProps.channelIdString
);
const [slotLagMBAlertThreshold, setSlotLagMBAlertThreshold] =
useState<number>(alertProps.slotLagMBAlertThreshold);
const [slotLagGBAlertThreshold, setSlotLagGBAlertThreshold] =
useState<number>(alertProps.slotLagGBAlertThreshold);
const [openConnectionsAlertThreshold, setOpenConnectionsAlertThreshold] =
useState<number>(alertProps.openConnectionsAlertThreshold);
const [loading, setLoading] = useState(false);
Expand All @@ -54,7 +54,7 @@ const NewAlertConfig = (alertProps: AlertConfigProps) => {
serviceConfig: {
auth_token: authToken ?? '',
channel_ids: channelIdString?.split(',')!,
slot_lag_mb_alert_threshold: slotLagMBAlertThreshold || 5000,
slot_lag_mb_alert_threshold: slotLagGBAlertThreshold * 1000 || 20000,
open_connections_alert_threshold: openConnectionsAlertThreshold || 5,
},
};
Expand Down Expand Up @@ -132,14 +132,14 @@ const NewAlertConfig = (alertProps: AlertConfigProps) => {
</div>

<div>
<p>Slot Lag Alert Threshold (in MB)</p>
<p>Slot Lag Alert Threshold (in GB)</p>
<TextField
style={{ height: '2.5rem', marginTop: '0.5rem' }}
variant='simple'
type={'number'}
placeholder='optional'
value={slotLagMBAlertThreshold}
onChange={(e) => setSlotLagMBAlertThreshold(e.target.valueAsNumber)}
value={slotLagGBAlertThreshold}
onChange={(e) => setSlotLagGBAlertThreshold(e.target.valueAsNumber)}
/>
</div>

Expand Down
6 changes: 3 additions & 3 deletions ui/app/alert-config/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const AlertConfigPage: React.FC = () => {
serviceType: '',
authToken: '',
channelIdString: '',
slotLagMBAlertThreshold: 5000,
slotLagGBAlertThreshold: 20,
openConnectionsAlertThreshold: 5,
forEdit: false,
};
Expand All @@ -48,8 +48,8 @@ const AlertConfigPage: React.FC = () => {
serviceType: alertConfig.service_type,
authToken: JSON.parse(configJSON)?.auth_token,
channelIdString: channelIds.join(','),
slotLagMBAlertThreshold:
JSON.parse(configJSON)?.slot_lag_mb_alert_threshold,
slotLagGBAlertThreshold:
(JSON.parse(configJSON)?.slot_lag_mb_alert_threshold as number) / 1000,
openConnectionsAlertThreshold:
JSON.parse(configJSON)?.open_connections_alert_threshold,
forEdit: true,
Expand Down

0 comments on commit 61f33a0

Please sign in to comment.