Skip to content

Commit

Permalink
Bump elastic-charts to 46.9.0 (#74)
Browse files Browse the repository at this point in the history
* Bump elastic-charts to 46.9.0

* Add useEffect dependencies

This ensures logging only happens if state changes.

* Clean up log messages
  • Loading branch information
jbcrail authored and rockdaboot committed Jul 5, 2022
1 parent 6ab420e commit 96c06a6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/plugins/profiling/public/components/bar-chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface BarChartProps {
export const BarChart: React.FC<BarChartProps> = ({ id, name, height, data, x, y }) => {
useEffect(() => {
console.log(new Date().toISOString(), 'updated bar-chart');
});
}, [id, name, height, data, x, y]);

return (
<Chart size={{ height }}>
Expand Down
4 changes: 3 additions & 1 deletion src/plugins/profiling/public/components/chart-grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@ export const ChartGrid: React.FC<ChartGridProps> = ({ maximum }) => {
}
return charts;
};

useEffect(() => {
console.log(new Date().toISOString(), 'updated chart-grid');
});
}, [ctx]);

return (
<>
<EuiSpacer />
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/profiling/public/components/flamegraph-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import React, { useEffect } from 'react';

export const FlameGraphNavigation = ({ index, projectID, n, timeRange, getter, setter }) => {
useEffect(() => {
console.log(new Date().toISOString(), timeRange);
console.log(new Date().toISOString(), 'started payload retrieval');
getter(index, projectID, timeRange.unixStart, timeRange.unixEnd, n).then((response) => {
console.log(new Date().toISOString(), 'finished payload retrieval');
console.log(new Date().toISOString(), response);
setter(response);
console.log(new Date().toISOString(), 'updated local state');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ export const StackedBarChart: React.FC<StackedBarChartProps> = ({
category,
}) => {
const ctx = useContext(TopNContext);

useEffect(() => {
console.log(new Date().toISOString(), 'updated stacked-bar-chart');
});
}, [ctx, id, name, x, y, category]);

return (
<Chart size={{ height }}>
<Settings showLegend={false} />
Expand Down

0 comments on commit 96c06a6

Please sign in to comment.