Coder Social home page Coder Social logo

Comments (7)

andrewserff avatar andrewserff commented on August 16, 2024

From what it sounds like, you want to generate a number of events and generate them in order. This is definitely doable with this framework. You can also simulate multiple users. If you take a look at the exampleWorkflow.js in the src/dist/conf directory, you see that this workflow simulates a person entering a building, logging into a computer, performing some random actions, and then logging out and leaving. The events are generated in the order they are placed in the config's steps property.

To have multiple users you would create multiple Workflows (if you wanted them to be different) and then list them in the Sim Config workflows. Then both of those workflows will run when the simulation starts.

You mentioned a "cursor" and the is a type of cursor, but only within an event. See the this.propName and cur.propName sections of the documentation. These allow you to reference already generated values, but only within the current json event being generated. You can't currently reference values within a previously generated event unfortunately.

Hope this helps! If not, let me know.

from json-data-generator.

ericchaves avatar ericchaves commented on August 16, 2024

Hi Andrew, thanks for the promptly reply. In the exempleWorkflow.js, the user enters the build, logs in, performs a single action and leave.

how would you do have a random number of actions for a given step instead of a single action? is, user enters build (1 step/1 event), logs in (1 step/1 event), performs a random number of actions (1 step/N events)? Is it possible?

Thanks again for the help

from json-data-generator.

andrewserff avatar andrewserff commented on August 16, 2024

Yes, that's possible. Check out the Step's duration config option in the documentation. It gives you the different ways to set it for what you want.

from json-data-generator.

ericchaves avatar ericchaves commented on August 16, 2024

Hi Andrew,

One last question, is it possible to format dates and numbers? I tried date().toString('yyyy/MM/dd') but it has no effect.

If you allow me a feature suggestion, it would be great to have a put/get function to add into a kind of session object, allowing us to share some values in running workflow. Something like:

steps:[
{config:[{ "birthdate": "put(date(),'birthday')"},{...},{...}]},
{config:[{"userBirthdate":"get('birthday')"}]}]

from json-data-generator.

andrewserff avatar andrewserff commented on August 16, 2024

Unfortunately, there is no way to format a date. Also, as you noticed, there is no type of session/context. Both are good ideas though! Feel free to submit them both as feature requests. If you have time to implement either, we always welcome pull requests!

from json-data-generator.

andrewserff avatar andrewserff commented on August 16, 2024

Closing based on lack of activity. If there is still an issue, please let me know.

from json-data-generator.

andrewserff avatar andrewserff commented on August 16, 2024

The idea of state was referenced here and I'm trying to track those request in #28

from json-data-generator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.