-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
Support for manual transaction logging #853
base: main
Are you sure you want to change the base?
Conversation
…s will help to keep real HttpTransaction entity internal and don't expose it
…ion can be saved into db via this method.
I've checked issues and found that issue #140 also wants this feature. |
/** | ||
* Represent Manual Http transaction that developer want to populate as an custom http transaction | ||
*/ | ||
public data class ManualHttpTransaction( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need another class here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't want to move the HttpTransaction
class to the API package or expose it to the developer. I could use a builder pattern to build transaction objects or create a method with a bunch of args in the ChuckerCollector
class.
But both of these mentioned approaches have their downsides regarding logging the data. In this implemented approach, to log a transaction's start and end information, the developer no longer needs to store the data in a separate data store and can create the model and fill it in during transactions. In the end, the developer can save the object in the chucker.
Thanks for sending this @aliab 🙏 I think we can simplify this a bit |
I tried to make as few changes as possible. btw, I want this feature in my app and if you give me a hint about your idea, maybe I could deliver it sooner. |
@cortinico kindly reminder |
Hey @aliab Exposing the Manual class you suggested exposes us to having to maintain this in the long run. As we're planning on potentially separating requests and responses, having a class in the public API which doesn't follow this design would be harder to maintain the future. Let's get back to this once we're done with the redesign. |
📄 Context
Add Support for manual transaction logging in the chucker. For example, developers can populate
MQTT
orFCM messages
transactions into their chucker log; these are other types of network traffic, and showing them in chucker makes this library more generic for network transaction logging.📝 Changes
saveTransaction(transaction: ManualHttpTransaction)
method toChuckerCollector
to save manual transaction data into DB.ManualHttpTransaction
entity to the API package for the manual type of logging. It is wrapped over the internalHttpTransaction
entity and ensures that previous visibility is not violated.🚫 Breaking
No breaking changes introduced
🛠️ How to test
Just run the sample app. The new ManualTransactionTask is added to the sample app
MainActivity
httpTasks to test if this feature is working OK.