feat: added a function to track fuel consumption#807
Conversation
|
Thanks for working on this! I think this could be very helpful, one thing worth noting is the fuel is currently reset for before each call - I'm not sure if this will be an issue for your use case. I have a branch with a slightly simplified implementation here: https://github.com/extism/extism/tree/consumed-fuel-direct - it avoids the extra field on |
|
We actually want fuel to be reset for each call, the usecase for us is to see how much fuel is consumed by a call so that we can keep track of this. I don't see a reason to store it if it's reset after every call. Calling it directly like in your branch is better I think. |
|
Great, I will push up my changes to your branch and merge once CI passes! |
This PR adds a function to get the fuel consumed by a plugin. This is useful for systems that want to fairly balance compute. It's my first time doing anything in rust so let me know if something needs improvements!