Skip to content

Commit

Permalink
Merge pull request #9246 from vikram-raj/bz-1972016
Browse files Browse the repository at this point in the history
Bug 1972016: Fix time range issue for devconsole monitoring dashboard
  • Loading branch information
openshift-merge-robot committed Jun 15, 2021
2 parents 694f412 + 31b7200 commit ade011a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,17 @@ type MonitoringDashboardProps = {
type StateProps = {
timespan: number;
pollInterval: number;
endTime: number;
};

type Props = MonitoringDashboardProps & StateProps;

export const MonitoringDashboard: React.FC<Props> = ({ match, timespan, pollInterval }) => {
export const MonitoringDashboard: React.FC<Props> = ({
match,
timespan,
pollInterval,
endTime,
}) => {
const { t } = useTranslation();
const namespace = match.params.ns;
const params = getURLSearchParams();
Expand Down Expand Up @@ -104,6 +110,7 @@ export const MonitoringDashboard: React.FC<Props> = ({ match, timespan, pollInte
key={q.title}
timespan={timespan}
pollInterval={pollInterval}
endTime={endTime}
/>
))}
</Dashboard>
Expand All @@ -115,6 +122,7 @@ export const MonitoringDashboard: React.FC<Props> = ({ match, timespan, pollInte
const mapStateToProps = (state: RootState): StateProps => ({
timespan: state.UI.getIn(['monitoringDashboards', 'timespan']),
pollInterval: state.UI.getIn(['monitoringDashboards', 'pollInterval']),
endTime: state.UI.getIn(['monitoringDashboards', 'endTime']),
});

export default connect<StateProps, MonitoringDashboardProps>(mapStateToProps)(MonitoringDashboard);
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type MonitoringDashboardGraphProps = {
byteDataType: ByteDataTypes;
timespan?: number;
pollInterval?: number;
endTime?: number;
};

const DEFAULT_TIME_SPAN = 30 * 60 * 1000;
Expand All @@ -36,6 +37,7 @@ export const MonitoringDashboardGraph: React.FC<MonitoringDashboardGraphProps> =
graphType = GraphTypes.area,
timespan,
pollInterval,
endTime,
}) => {
const { t } = useTranslation();
return (
Expand All @@ -59,6 +61,7 @@ export const MonitoringDashboardGraph: React.FC<MonitoringDashboardGraphProps> =
isStack={graphType === GraphTypes.area}
timespan={timespan}
pollInterval={pollInterval}
fixedEndTime={endTime}
formatSeriesTitle={(labels) => labels.pod}
showLegend
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ describe('Monitoring Dashboard Tab', () => {
},
timespan: 1800000,
pollInterval: 90000,
endTime: 1900000,
};

it('should render Monitoring Dashboard tab', () => {
Expand Down

0 comments on commit ade011a

Please sign in to comment.