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

[Console] Configure refresh frequency #121874

Merged
merged 5 commits into from
Dec 29, 2021
Merged

Conversation

mibragimov
Copy link
Contributor

@mibragimov mibragimov commented Dec 22, 2021

Closes #119218

Capture

@mibragimov mibragimov added release_note:enhancement Feature:Console Dev Tools Console Feature Feature:Dev Tools backport:skip This commit does not require backporting v8.1.0 labels Dec 22, 2021
@mibragimov mibragimov self-assigned this Dec 22, 2021
Copy link
Contributor

@Kuznietsov Kuznietsov left a comment

Choose a reason for hiding this comment

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

@mibragimov, thanks for your efforts 👍

It has left some minor changes to be done. I'm sure, you'll fix that very quickly )

@Kuznietsov Kuznietsov added Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more loe:small Small Level of Effort impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. labels Dec 24, 2021
Copy link
Member

@sabarasaba sabarasaba left a comment

Choose a reason for hiding this comment

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

Left some initial feedback for now, lets keep the conversation going and we can do a full review after we are all happy with the approach to take 🚀

@Kuznietsov Kuznietsov self-requested a review December 24, 2021 16:46
Copy link
Member

@sabarasaba sabarasaba left a comment

Choose a reason for hiding this comment

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

Thank for patching this up @mibragimov! Latest changes lgtm, left one small nit that I think could simplify the code a little bit but its a non-blocker 🚀

PS: Could we also update the screenshot of the PR?


export type AutocompleteOptions = 'fields' | 'indices' | 'templates';

const MILLISECONDS_IN_MINUTE = 60000;
Copy link
Member

Choose a reason for hiding this comment

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

nit: what do you think about replacing these constants and the intervalOptions definition with something more compact that uses pluralization:

const PRESETS_IN_MINUTES = [1, 5, 10];
const intervalOptions = PRESETS_IN_MINUTES.map(value => ({
    value: value * 60000,
    text: i18n.translate('console.settingsPage.refreshInterval.timeInterval', {
        defaultMessage: '{value} {value, plural, one {minute} other {minutes}}',
        values: { value },
    }),
}));

compressed
options={intervalOptions}
value={pollInterval}
onChange={(e) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

please try to use useCallback hook to avoid extra rerenderings 🙏

@mibragimov mibragimov marked this pull request as ready for review December 28, 2021 10:13
@mibragimov mibragimov requested a review from a team as a code owner December 28, 2021 10:13
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-stack-management (Team:Stack Management)

@mibragimov
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
console 376.2KB 377.0KB +780.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @mibragimov

Copy link
Contributor

@Kuznietsov Kuznietsov left a comment

Choose a reason for hiding this comment

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

Code LGTM 🚀

@@ -87,13 +89,22 @@ export class Settings {
return this.storage.get('disable_history', DEFAULT_SETTINGS.historyDisabled);
}

setPollInterval(interval: number) {
this.storage.set('poll_interval', interval);
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: it would be a great idea to move these identificators ( 'poll_interval', for example) to the constant variables. What do you think about it?

@cjcenizal
Copy link
Contributor

cjcenizal commented Dec 28, 2021

@mibragimov Regarding this point from #119218:

Request once on load, but disable polling

This is actually a separate feature from the user-specified poll frequency. The idea was to provide the user with a toggle that, when enabled, would cause Console to only request the mappings, aliases, and templates when it's loaded, instead of on an interval. Does that make sense?

@mibragimov
Copy link
Contributor Author

@mibragimov Regarding this point from #119218:

Request once on load, but disable polling

This is actually a separate feature from the user-specified poll frequency. The idea was to provide the user with a toggle that, when enabled, would cause Console to only request the mappings, aliases, and templates when it's loaded, instead of on an interval. Does that make sense?

Got it. I created a separate PR for this feature #122125

@mibragimov mibragimov merged commit b714f41 into elastic:main Dec 29, 2021
@mibragimov mibragimov deleted the polling branch December 29, 2021 11:45
gbamparop pushed a commit to gbamparop/kibana that referenced this pull request Jan 12, 2022
* Add configurable poll interval

Co-authored-by: Muhammad Ibragimov <muhammad.ibragimov@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Console Dev Tools Console Feature Feature:Dev Tools impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort release_note:enhancement Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configure Console refresh frequency
8 participants