Skip to content

feat: improve sink mview throughput metrics #12622

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

Merged
merged 8 commits into from
Oct 6, 2023

Conversation

fuyufjh
Copy link
Collaborator

@fuyufjh fuyufjh commented Oct 4, 2023

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

This PR is a complete refactor of #11328.

This previous implementation reuses stream_executor_row_count, but disables this metrics for all executors except SinkExecutor and MaterializeExecutor, which is a little bit ugly (also pointed by #11328 (comment)).

risingwave-dev-dashboard:

risingwave-dev-dashboard

risingwave-user-dashboard:

Screenshot 2023-10-04 at 12 22 07

This PR simply introduces 2 new metrics

  • stream_sink_input_row_count
  • stream_mview_input_row_count

Just as the name says, they count the input rows for sink and materialized views respectively.

Meanwhile, stream_executor_row_count is completely disabled.

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

@fuyufjh fuyufjh requested review from hzxa21, lmatz and BugenZhao October 4, 2023 04:31
@github-actions github-actions bot added the type/feature Type: New feature. label Oct 4, 2023
@codecov
Copy link

codecov bot commented Oct 4, 2023

Codecov Report

Merging #12622 (a5d5dfc) into main (f26ac7a) will decrease coverage by 0.06%.
Report is 1 commits behind head on main.
The diff coverage is 48.97%.

@@            Coverage Diff             @@
##             main   #12622      +/-   ##
==========================================
- Coverage   69.37%   69.31%   -0.06%     
==========================================
  Files        1470     1470              
  Lines      241241   241233       -8     
==========================================
- Hits       167354   167216     -138     
- Misses      73887    74017     +130     
Flag Coverage Δ
rust 69.31% <48.97%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/connector/src/sink/catalog/mod.rs 56.88% <100.00%> (+0.58%) ⬆️
src/stream/src/executor/monitor/streaming_stats.rs 100.00% <100.00%> (ø)
src/stream/src/executor/mview/materialize.rs 89.39% <ø> (ø)
src/stream/src/executor/sink.rs 96.19% <100.00%> (-0.04%) ⬇️
src/stream/src/from_proto/sink.rs 0.00% <ø> (ø)
src/stream/src/task/stream_manager.rs 1.85% <0.00%> (+0.01%) ⬆️
src/meta/src/rpc/metrics.rs 77.98% <16.66%> (-0.12%) ⬇️
src/stream/src/executor/wrapper.rs 0.00% <0.00%> (ø)
src/stream/src/executor/wrapper/trace.rs 0.00% <0.00%> (ø)

... and 15 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

/// [`WrapperExecutor`] will do some sanity checks and logging for the wrapped executor.
pub struct WrapperExecutor {
input: BoxedExecutor,

extra: ExtraInfo,
actor_ctx: ActorContextRef,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Did some refactoring here: Replaced ExtraInfo with ActorContextRef.

.streaming_metrics
.sink_input_row_count
.with_label_values(&[&sink_id_str, &actor_id_str, &fragment_id_str])
.inc_by(c.capacity() as u64);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note that the metrics is actually the input rows of Sink (previously, it's output). This is because we don't have a well definition for the output of sinks yet.

Technically, the input and output rows might be different because of force_append_only etc., but either can be a good reference.

@fuyufjh fuyufjh force-pushed the eric/improve_sink_mview_throughput_metrics branch from 01d08fe to 7bfa479 Compare October 4, 2023 08:14
@lmatz
Copy link
Contributor

lmatz commented Oct 5, 2023

Introducing independent metrics for sink and materialized view is the approach taken at the very beginning...... It was argued not good

@fuyufjh
Copy link
Collaborator Author

fuyufjh commented Oct 5, 2023

Introducing independent metrics for sink and materialized view is the approach taken at the very beginning...... It was argued not good

Can you tell the reasons? Sorry I didn't know about the discussion.

My motivation is that I hope to completely remove (disable) any executor-level metrics.

@lmatz
Copy link
Contributor

lmatz commented Oct 5, 2023

ok not really bad, I suppose it is an argument for generality: #9874

@fuyufjh fuyufjh enabled auto-merge October 6, 2023 09:12
@fuyufjh fuyufjh added this pull request to the merge queue Oct 6, 2023
Merged via the queue into main with commit 3fbe1ab Oct 6, 2023
@fuyufjh fuyufjh deleted the eric/improve_sink_mview_throughput_metrics branch October 6, 2023 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature Type: New feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants