Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Add progress bar for initialization #253

Conversation

yizheliu-amazon
Copy link
Contributor

@yizheliu-amazon yizheliu-amazon commented Jul 16, 2020

Issue #, if available:

Description of changes:
Add progress bar for initialization

Initializing normally:
Screen Shot 2020-07-15 at 3 03 47 PM

When initializing is overtime:

Screen Shot 2020-07-16 at 6 17 26 PM

When data is missing during initializing:
Screen Shot 2020-07-16 at 6 53 58 PM

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@yizheliu-amazon yizheliu-amazon added the enhancement Enhance current feature for better performance, user experience, etc label Jul 16, 2020
@@ -343,7 +346,7 @@ export const DetectorDetail = (props: DetectorDetailProps) => {
<EuiFlexGroup>
<EuiFlexItem>
<EuiTabs>
{tabs.map(tab => (
{tabs.map((tab) => (
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

automatically changed by linter I guess. same for the other similar changes.

server/routes/ad.ts Outdated Show resolved Hide resolved
</EuiFlexGroup>
<EuiSpacer size="l" />
</div>
) : null}
<EuiButton
onClick={props.onSwitchToConfiguration}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have a switch to configuration button when the configuration tab is only a finger click away?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this was just part of the existing approved UI, but agreed that it doesn't really seem necessary with the tab right above. Guess it was for quickly navigating to config page since a config change must have occurred for initialization process to begin again / for callout to appear again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this already exists in UX design since long time ago. This configuration button is shown in callout because all the messages in callout mentions detector configuration, and such button can direct user quickly to detector config page .

@@ -292,6 +295,17 @@ export function AnomalyResults(props: AnomalyResultsProps) {
</p>
) : isInitializingNormally ? (
<p>
{detector.initProgress
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to show the message besides isInitializingNormally? When it is over time, I can see a need for customer to ask when it is gonna finish.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, will add it for overtime case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will also add that message to missing data case as well.

@@ -110,6 +114,13 @@ export function AnomalyResults(props: AnomalyResultsProps) {
const monitors = useSelector((state: AppState) => state.alerting.monitors);
const monitor = get(monitors, `${detectorId}.0`);

const [featureMissingSeverity, setFeatureMissingSeverity] = useState<
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simply move 2 lines of code from below to above.

const getInitProgressMessage = () => {
return detector && isDetectorInitializing && detector.initProgress
? `The detector needs to capture approximately
${detector.initProgress.neededShingles} data points for initializing. If your data stream is continuous, this process will take around
Copy link
Contributor

@ylwu-amzn ylwu-amzn Jul 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about change ${detector.initProgress.neededShingles} data points for initializing to ${detector.initProgress.neededShingles} more data points for initializing?

Confirm with tech writer about the wording.

Copy link
Contributor

@ylwu-amzn ylwu-amzn Jul 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, seems I misunderstood it. Here the ${detector.initProgress.neededShingles} is the total data points needed or we still need such more data points? Same question for estimatedMinutesLeft

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“data points” should be replaced by shingles.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re Yaliang: we still need such more data points.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“data points” should be replaced by shingles.

Should we expose shingle, which is one internal term, to customer? I think data points expresses the same thing, and it is more user-friendly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, I see, sound like shingles are "consecutive data points", is it right?

Copy link
Member

@kaituo kaituo Jul 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. A shingle is a consecutive sequence of the most recent records.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about using "consecutive data points", my point is that shingle is not intuitive word for user, and we only have definition of what shingle process means in the doc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after discussing offline with Kaituo, we may remove the message regarding shingle/data point which may be confusing to user, while provide needed time and percentage only.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wording has been confirmed with tech writer.

return detector && isDetectorInitializing && detector.initProgress
? `The detector needs to capture approximately
${detector.initProgress.neededShingles} data points for initializing. If your data stream is continuous, this process will take around
${detector.initProgress.estimatedMinutesLeft} minutes; if not, it may take even longer. `
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just confirm, is the detector state based on how many data points in the tree? I remember our testing detector on NAB data will become running quickly before capturing 128 data points as cold start will build RCF model first. I'm asking this to make sure the detector state, neededShingles and estimatedMinutesLeft can match.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the detector state based on how many data points in the tree

yes

The number would be the total data points in the tree before cold start, and needed shingles after cold start. In your NAB example, we should only see this message briefly and the progress bar should disappear as initialization is finished.

const getInitProgressMessage = () => {
return detector && isDetectorInitializing && detector.initProgress
? `The detector needs to capture approximately
${detector.initProgress.neededShingles} data points for initializing. If your data stream is continuous, this process will take around
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“data points” should be replaced by shingles.

const getInitProgressMessage = () => {
return detector && isDetectorInitializing && detector.initProgress
? `The detector needs to capture approximately
${detector.initProgress.neededShingles} data points for initializing. If your data stream is continuous, this process will take around
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re Yaliang: we still need such more data points.

return detector && isDetectorInitializing && detector.initProgress
? `The detector needs to capture approximately
${detector.initProgress.neededShingles} data points for initializing. If your data stream is continuous, this process will take around
${detector.initProgress.estimatedMinutesLeft} minutes; if not, it may take even longer. `
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the detector state based on how many data points in the tree

yes

The number would be the total data points in the tree before cold start, and needed shingles after cold start. In your NAB example, we should only see this message briefly and the progress bar should disappear as initialization is finished.

@yizheliu-amazon yizheliu-amazon merged commit ecf4d29 into opendistro-for-elasticsearch:master Jul 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Enhance current feature for better performance, user experience, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants