Change default refresh interval to 10 seconds (#144389)

This commit is contained in:
Søren Louv-Jansen 2022-12-01 13:42:10 +01:00 committed by GitHub
parent bb4012664a
commit f3d12b33e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View file

@ -324,8 +324,8 @@ export function getUiSettings(
defaultMessage: 'Time filter refresh interval',
}),
value: `{
"pause": false,
"value": 0
"pause": true,
"value": 60000
}`,
type: 'json',
description: i18n.translate('data.advancedSettings.timepicker.refreshIntervalDefaultsText', {

View file

@ -76,7 +76,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const expectedUrl =
baseUrl +
'/app/discover?_t=1453775307251#' +
'/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time' +
'/?_g=(filters:!(),refreshInterval:(pause:!t,value:60000),time' +
":(from:'2015-09-19T06:31:44.000Z',to:'2015-09" +
"-23T18:31:44.000Z'))&_a=(columns:!(),filters:!(),index:'logstash-" +
"*',interval:auto,query:(language:kuery,query:'')" +
@ -102,7 +102,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
baseUrl +
'/app/discover#' +
'/view/ab12e3c0-f231-11e6-9486-733b1ac9221a' +
'?_g=(filters%3A!()%2CrefreshInterval%3A(pause%3A!t%2Cvalue%3A0)' +
'?_g=(filters%3A!()%2CrefreshInterval%3A(pause%3A!t%2Cvalue%3A60000)' +
"%2Ctime%3A(from%3A'2015-09-19T06%3A31%3A44.000Z'%2C" +
"to%3A'2015-09-23T18%3A31%3A44.000Z'))";
await PageObjects.discover.loadSavedSearch('A Saved Search');

View file

@ -38,9 +38,9 @@ export const useRefreshInterval = (
function initAutoRefresh() {
const interval = globalState?.refreshInterval ?? timefilter.getRefreshInterval();
const { value } = interval;
const { pause, value } = interval;
if (value === 0) {
if (pause === true || value === 0) {
// the auto refresher starts in an off state
// so switch it on and set the interval to 30s
timefilter.setRefreshInterval({

View file

@ -61,7 +61,7 @@ const PageWrapper: FC<PageProps> = ({ deps }) => {
useEffect(() => {
const refreshInterval =
refreshValue === 0 && refreshPause === true
refreshValue === 0 || refreshPause === true
? { pause: false, value: DEFAULT_REFRESH_INTERVAL_MS }
: { pause: refreshPause, value: refreshValue };
timefilter.setRefreshInterval(refreshInterval);