Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] AIOps Log Rate Analysis: Fix date picker refresh button. #183768

Merged
merged 4 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,14 @@ export const DualBrush: FC<DualBrushProps> = (props) => {
]);
}

brushes.current[0].start = snappedWindowParameters.baselineMin;
brushes.current[0].end = snappedWindowParameters.baselineMax;
brushes.current[1].start = snappedWindowParameters.deviationMin;
brushes.current[1].end = snappedWindowParameters.deviationMax;
if (id === 'baseline') {
brushes.current[0].start = snappedWindowParameters.baselineMin;
brushes.current[0].end = snappedWindowParameters.baselineMax;
}
if (id === 'deviation') {
brushes.current[1].start = snappedWindowParameters.deviationMin;
brushes.current[1].end = snappedWindowParameters.deviationMax;
}

if (onChange) {
onChange(snappedWindowParameters, newBrushPx);
Expand All @@ -263,7 +267,10 @@ export const DualBrush: FC<DualBrushProps> = (props) => {
return 'aiopsBrush' + b.id.charAt(0).toUpperCase() + b.id.slice(1);
})
.each((brushObject: DualBrush, i, n) => {
const x = d3.scaleLinear().domain([min, max]).rangeRound([0, widthRef.current]);
const x = d3
.scaleLinear()
.domain([minRef.current, maxRef.current])
.rangeRound([0, widthRef.current]);
// Ensure brush style is applied
brushObject.brush.extent([
[0, BRUSH_MARGIN],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export function getDocumentCountStatsSplitLabel(
}

export interface LogRateAnalysisContentProps {
/** Optional time range override */
timeRange?: { min: Moment; max: Moment };
/** Elasticsearch query to pass to analysis endpoint */
esSearchQuery?: estypes.QueryDslQueryContainer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const LogRateAnalysisPage: FC<Props> = ({ stickyHistogram }) => {
);

useEffect(
// TODO: Consolidate this hook/function with with Data visualizer's
// TODO: Consolidate this hook/function with the one in `x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx`
function clearFiltersOnLeave() {
return () => {
// We want to clear all filters that have not been pinned globally
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/aiops/public/hooks/use_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ export const useData = (
time: timefilter.getTime(),
refreshInterval: timefilter.getRefreshInterval(),
});
setLastRefresh(Date.now());
}
setLastRefresh(Date.now());
});

// This listens just for an initial update of the timefilter to be switched on.
Expand Down