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

Introduce TransformContextConfig #1490

Merged
merged 1 commit into from
Feb 23, 2024

Conversation

rukai
Copy link
Member

@rukai rukai commented Feb 21, 2024

This PR introduces the TransformContextConfig struct which is passed to each transform at the point where the TransformConfig is converted to a TransformBuilder. i.e. during shotover initialization

This enables a whole bunch of potential optimizations where we pass in some extra information about the context the transform is in. i.e. the chain its in and what other transforms are in its chain.
A potential future optimization would be detecting if the next transform is going to discard any responses passed to it.
This would allow for a nice optimization to the Filter transform where we skip error generation if its in a Tee subchain configured to discard responses.

However right now, TransformContextConfig just contains:

  • the name of the chain which we currently use in various diagnostics.
  • The protocol that the transform will be processing, currently there is no usages of this information but I plan to use it as part of the port of the Tee transform to use MessageId.

Additionally the CodecBuilder::websocket_subprotocol is turned into a CodecBuilder::protocol so that we can obtain the protocol to insert into the TransformContextConfig.

@rukai rukai force-pushed the Introduce-TransformContextConfig branch 3 times, most recently from 6173de6 to c8917d7 Compare February 21, 2024 03:19
@rukai rukai requested a review from conorbros February 21, 2024 03:54
@rukai rukai force-pushed the Introduce-TransformContextConfig branch from c8917d7 to 88d89e3 Compare February 21, 2024 04:21
Copy link

0 benchmark regressed. 2 benchmark improved. Please check the benchmark workflow logs for full details: https://github.com/shotover/shotover-proxy/actions/runs/7983958020

Found 4 outliers among 100 measurements (4.00%)
  2 (2.00%) high mild
  2 (2.00%) high severe
cassandra_codec/encode_system.local_query_v5_lz4_compression
                        time:   [1.2365 µs 1.2500 µs 1.2649 µs]
                        change: [-25.102% -23.312% -21.424%] (p = 0.00 < 0.05)
                        Performance has improved.
--
Found 2 outliers among 100 measurements (2.00%)
  1 (1.00%) high mild
  1 (1.00%) high severe
cassandra_codec/encode_system.local_result_v5_no_compression
                        time:   [19.105 µs 19.418 µs 19.729 µs]
                        change: [-32.891% -29.128% -25.464%] (p = 0.00 < 0.05)
                        Performance has improved.

@rukai rukai mentioned this pull request Feb 21, 2024
@rukai rukai force-pushed the Introduce-TransformContextConfig branch from 88d89e3 to ece3e46 Compare February 22, 2024 00:23
Copy link

0 benchmark regressed. 1 benchmark improved. Please check the benchmark workflow logs for full details: https://github.com/shotover/shotover-proxy/actions/runs/8010212497

                        No change in performance detected.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high severe
cassandra_codec/encode_system.local_result_v4_no_compression
                        time:   [19.978 µs 20.563 µs 21.188 µs]
                        change: [-30.759% -26.802% -22.632%] (p = 0.00 < 0.05)
                        Performance has improved.

@rukai rukai force-pushed the Introduce-TransformContextConfig branch from ea80a2a to e8c213a Compare February 23, 2024 03:32
@conorbros conorbros merged commit a8ba522 into shotover:main Feb 23, 2024
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants