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

Add start/duration options to the defined activity configuration #168

Closed
bjohnson5 opened this issue Feb 29, 2024 · 5 comments · Fixed by #173
Closed

Add start/duration options to the defined activity configuration #168

bjohnson5 opened this issue Feb 29, 2024 · 5 comments · Fixed by #173
Assignees
Labels
feature New feature or request
Milestone

Comments

@bjohnson5
Copy link
Collaborator

Describe desired feature

Currently when you are defining specific activity you can only define an interval and amount. It would be helpful to be able to pick a start time and duration so that some nodes are sending transactions at different times throughout the simulation.

Use case for feature

For example:
This activity definition would tell Alice to send 2000 msats every second, starting 10 seconds after the simulation starts and ending after 30 seconds. In other words, Alice would send Bob 30 transactions between 10 and 40 seconds in the simulation.

  "activity": [
    {
      "source": "Alice",
      "destination": "Bob",
      "start": 10,
      "duration": 30
      "interval_secs": 1,
      "amount_msat": 2000
    }
  ]

Would you like to contribute code for this feature?

I am interested and hope to contribute toward this feature.

@bjohnson5 bjohnson5 added the feature New feature or request label Feb 29, 2024
@carlaKC
Copy link
Contributor

carlaKC commented Mar 2, 2024

I think this would be a very nice feature!

"start": 10,
"duration": 30

Small user-experience related question: WDTY about count rather than a duration so that we can save the end user some calculation? I would imagine that people know how many of this type of payment they want and then calculate the duration from that anyway. But defer to your pref since this is a feature that you want/ I know no better!

One thing we'd need to think about in the context of the project is handling shutdown if we have a set of these activitiesf and they all finish. Currently doing some refactoring in #164 to neaten up all of our shutdown mechanics, so it shouldn't be difficult (it should just be handled because the producer/consumer will drop, but just flagging it because we've got tasks flying all over the place and it's easy to lose track).

@bjohnson5
Copy link
Collaborator Author

bjohnson5 commented Mar 5, 2024

Yes I like count better! I think that makes more sense from a user's perspective. I will start looking into implementing this in conjunction with the performance testing I am doing on LND. This will be helpful for my testing because I would like to have varying levels of transaction traffic throughout the simulation and observe the performance difference. So it would be great if I could set some activity to start later in the sim and then maybe drop off at some point.

I will also check out #164 and make sure this effort fits into that refactor. Thanks!

@carlaKC
Copy link
Contributor

carlaKC commented Mar 5, 2024

I will start looking into implementing this in conjunction with the performance testing I am doing on LND.

Sounds great!

@bjohnson5
Copy link
Collaborator Author

I am going to try to make this feature backwards compatible with older sim.json files. In other words.. the start and count values will not have to be defined in the sim.json file.

The count attribute will be an Optional<u64> where None means that the payment activity will continue for the full length of the simulation. If count is not provided in the sim.json file it will have a default value of None.

The start attribute will be a Duration and its default value will be 0, meaning the payments will start as soon as the simulation starts.

@carlaKC Any issues with that implementation? Trying to avoid making users re-create their simulation files.

bjohnson5 added a commit to bjohnson5/sim-ln that referenced this issue Mar 12, 2024
@carlaKC
Copy link
Contributor

carlaKC commented Mar 12, 2024

Any issues with that implementation?

SGTM!

bjohnson5 added a commit to bjohnson5/sim-ln that referenced this issue Mar 15, 2024
@carlaKC carlaKC added this to the V3 milestone Mar 27, 2024
carlaKC added a commit that referenced this issue Apr 4, 2024
Issue #168: Adding optional start and count values to sim.json file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants