-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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: Adds support to restore baseline/deviation from url state on page refresh #171398
[ML] [AIOps] Log Rate Analysis: Adds support to restore baseline/deviation from url state on page refresh #171398
Conversation
Pinging @elastic/ml-ui (:ml) |
@@ -15,25 +15,13 @@ import { isPopulatedObject } from '@kbn/ml-is-populated-object'; | |||
* @typedef {WindowParameters} | |||
*/ | |||
export interface WindowParameters { | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the JSDoc type annotations here because it's overly verbose and isn't needed to satisfy the docs script. There's also not really an IDE/Intellisense benefit when the file is TS anyway.
*/ | ||
|
||
import { getDefaultAiOpsListState, type AiOpsFullIndexBasedAppState } from './common'; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file was broke out from above application/url_state/common.ts
/** | ||
* Transforms a full window parameters object to the abbreviated url state version. | ||
*/ | ||
export const windowParameters2AppState = (wp?: WindowParameters): LogRateAnalysisAppState['wp'] => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I documented this in a separate issue to follow up with: #171657
The problem here is that the full time range doesn't include any data, we should recognize that and not show the brushes and UI below at all since there will be no results anyway. So this can happen by updating the date picker too, it's sort of unrelated to the url state update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/** | ||
* Transforms an abbreviated url state version of window parameters to its full version. | ||
*/ | ||
export const appState2WindowParameters = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I think we should keep function names clear and consistent - imo it would be preferable to have a slightly longer function name appStateToWindowParameters
than to introduce a number that has no meaning but to take the place of a word.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion, updated in 907d63b.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a small comment but overall LGTM ⚡
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: cc @walterra |
Summary
Part of #146166.
Support to restore baseline/deviation time ranges from url state on full page refresh.
Also updates functional tests to include a full page refresh after the first analysis run for each dataset.
Checklist