phoenix-dataplane / phoenix

Phoenix dataplane system service
https://phoenix-dataplane.github.io
Apache License 2.0
50 stars 9 forks source link

Add a Delay Engine #237

Closed Kristoff-starling closed 1 year ago

Kristoff-starling commented 1 year ago

Delay each RPC for 100ms with the probability 0.2. Currently, it's implemented in the simplest manner, i.e., use sleep syscall to suspend the coroutine.

Why are these changes needed?

A new engine that delays each RPC with a probability

Checks

Kristoff-starling commented 1 year ago

Hi @crazyboycjr, I'm a new intern in the UW System Group and am getting in touch with the mRPC project. Hope that the PR will be helpful and please feel free to point out any potential improvements. Thanks!

crazyboycjr commented 1 year ago

LGTM! Could you make it configurable (I'm aware that a few others are hard-coded now)? It should be quite straightforward. You could start from making eval/policy/delay/attach.toml look like this.

...
config_string = '''
# The probability to delay an RPC
probability = 0.2
# The delay in millisecond
delay_ms = 100
'''
crazyboycjr commented 1 year ago

btw, @Kristoff-starling could you please also run scripts/format.sh to pass the CI check?

Kristoff-starling commented 1 year ago

Sure. I'll finish the PR asap.