mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed excessive CPU usage by stopping the indefinite growth of the graph dataset. Fixes #5794
This commit is contained in:
parent
f8f00b4ecf
commit
8c2e965f6e
@ -36,3 +36,4 @@ Bug fixes
|
|||||||
| `Issue #5766 <https://redmine.postgresql.org/issues/5766>`_ - Fixed string indices must be integers issue for PostgreSQL < 9.3.
|
| `Issue #5766 <https://redmine.postgresql.org/issues/5766>`_ - Fixed string indices must be integers issue for PostgreSQL < 9.3.
|
||||||
| `Issue #5773 <https://redmine.postgresql.org/issues/5773>`_ - Fixed an issue where the application ignores the fixed port configuration value.
|
| `Issue #5773 <https://redmine.postgresql.org/issues/5773>`_ - Fixed an issue where the application ignores the fixed port configuration value.
|
||||||
| `Issue #5775 <https://redmine.postgresql.org/issues/5775>`_ - Ensure that 'setup-web.sh' should work in Debian 10.
|
| `Issue #5775 <https://redmine.postgresql.org/issues/5775>`_ - Ensure that 'setup-web.sh' should work in Debian 10.
|
||||||
|
| `Issue #5794 <https://redmine.postgresql.org/issues/5794>`_ - Fixed excessive CPU usage by stopping the indefinite growth of the graph dataset.
|
@ -67,7 +67,6 @@ export function getStatsUrl(sid=-1, did=-1, chart_names=[]) {
|
|||||||
* data to get the new state.
|
* data to get the new state.
|
||||||
*/
|
*/
|
||||||
export function statsReducer(state, action) {
|
export function statsReducer(state, action) {
|
||||||
let newState = {};
|
|
||||||
|
|
||||||
if(action.reset) {
|
if(action.reset) {
|
||||||
return action.reset;
|
return action.reset;
|
||||||
@ -82,21 +81,14 @@ export function statsReducer(state, action) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Object.keys(action.incoming).forEach(label => {
|
Object.keys(action.incoming).forEach(label => {
|
||||||
if(state[label]) {
|
let newEle = action.counter ? action.incoming[label] - action.counterData[label] : action.incoming[label];
|
||||||
|
state[label] = state[label] || [];
|
||||||
if(state[label].length >= X_AXIS_LENGTH) {
|
if(state[label].length >= X_AXIS_LENGTH) {
|
||||||
state[label].unshift();
|
state[label].pop();
|
||||||
}
|
|
||||||
newState[label] = [
|
|
||||||
action.counter ? action.incoming[label] - action.counterData[label] : action.incoming[label],
|
|
||||||
...state[label],
|
|
||||||
];
|
|
||||||
} else {
|
|
||||||
newState[label] = [
|
|
||||||
action.counter ? action.incoming[label] - action.counterData[label] : action.incoming[label],
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
state[label].unshift(newEle);
|
||||||
});
|
});
|
||||||
return newState;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
const chartsDefault = {
|
const chartsDefault = {
|
||||||
@ -263,6 +255,7 @@ export function GraphsWrapper(props) {
|
|||||||
const toStatsLegendRef = useRef();
|
const toStatsLegendRef = useRef();
|
||||||
const bioStatsLegendRef = useRef();
|
const bioStatsLegendRef = useRef();
|
||||||
const options = useMemo(()=>({
|
const options = useMemo(()=>({
|
||||||
|
normalized: true,
|
||||||
legendCallback: legendCallback,
|
legendCallback: legendCallback,
|
||||||
animation: {
|
animation: {
|
||||||
duration: 0,
|
duration: 0,
|
||||||
|
Loading…
Reference in New Issue
Block a user