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

ui: connect metrics provider to metrics timescale object #99712

Merged
merged 1 commit into from
Mar 28, 2023

Conversation

dhartunian
Copy link
Collaborator

Previously, the MetricsDataProvider component queried the redux store for the TimeScale object which contained details of the currently active time window. This piece of state was assumed to update to account for the "live" moving window that metrics show when pre-set lookback time windows are selected.

A recent PR: #98331 removed the feature that polled new data from SQL pages, which also disabled polling on metrics pages due to the re-use of TimeScale.

This commit modifies the MetricsDataProvider to instead read the metricsTime field of the TimeScaleState object. This object was constructed for use by the MetricsDataProvider but was not wired up to the component.

Resolves #99524

Epic: None

Release note: None

@dhartunian dhartunian requested review from xinhaoz and a team March 27, 2023 19:10
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@@ -167,6 +167,11 @@ export const selectTimeScale = createSelector(
timeScaleState => timeScaleState.scale,
);

export const selectMetricsTime = createSelector(
Copy link
Member

Choose a reason for hiding this comment

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

nit: Maybe we can remove the createSelector if it just returns the one field.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@dhartunian dhartunian added the backport-23.1.x Flags PRs that need to be backported to 23.1 label Mar 28, 2023
Previously, the `MetricsDataProvider` component queried the redux
store for the `TimeScale` object which contained details of the
currently active time window. This piece of state was assumed to
update to account for the "live" moving window that metrics show when
pre-set lookback time windows are selected.

A recent PR: cockroachdb#98331 removed the feature that polled new data from SQL
pages, which also disabled polling on metrics pages due to the re-use
of `TimeScale`.

This commit modifies the `MetricsDataProvider` to instead read the
`metricsTime` field of the `TimeScaleState` object. This object was
constructed for use by the `MetricsDataProvider` but was not wired up
to the component.

Resolves cockroachdb#99524

Epic: None

Release note: None
@dhartunian dhartunian force-pushed the db-console-metrics-refresh-bug branch from 8df26bd to 9880ad0 Compare March 28, 2023 14:13
@dhartunian
Copy link
Collaborator Author

bors r=xinhaoz

@craig craig bot merged commit 0745cd4 into cockroachdb:master Mar 28, 2023
@craig
Copy link
Contributor

craig bot commented Mar 28, 2023

Build succeeded:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-23.1.x Flags PRs that need to be backported to 23.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ui: metrics pages do not refresh automatically with new data
3 participants