question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to write my own engine? Docs?

See original GitHub issue

Hi i found the repository “https://github.com/shoreditch-ops/artillery-engine-kinesis” which seems to solve exactly what i need - writing my own engine… I did it already by forking the whole artillery repository and got it running, but it feels as a total overkill to fork the whole thing just to introduce a new engine.

But when i see code like this:

      let runnerEngines = _.map(
      Object.assign({}, Engines, runnableScript.config.engines),
      function loadEngine(engineConfig, engineName) {
        let moduleName = 'artillery-engine-' + engineName;
        try {
          if (Engines[engineName]) {
            moduleName = './engine_' + engineName;
          }
          let Engine = require(moduleName);
     ....

-> the runner code is hardcoded looking into his own folder relatively with all the entries of “Engines”… i don’t see how this should be dynamically able to pick up some new written engines at all oO

So… how should this work?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
kraenhansencommented, Mar 15, 2019

Another way to do this is to create a package that has a dependency on both artillery and your custom engine (could be installed from ./artillery-engine-custom), this way artillery core will be able to require in your custom engine correctly.

In your root project folder:

my-script.yml

An artillery script using your custom engine.

package.json

{
  "name": "my-load-tests",
  "version": "0.1.0",
  "scripts": {
    "test": "artillery run ./my-script.yml"
  },
  "dependencies": {
    "artillery": "^1.6.0-27",
    "artillery-engine-realm": "file:artillery-engine-custom"
  }
}

A directory called artillery-engine-custom

This should be a module named “artillery-engine-custom” which main script should export an engine.

1reaction
hassycommented, May 3, 2021

Ah sorry, the engine needs to be specified in config.engines like this:

config:
  target: localhost
  phases:
    - duration: 10
      arrivalRate: 1
      name: "Test Phase"
  engines:
    rsocket: {}

I was able to run your script + engine after adding that bit to the config. Let me know if you run into any other issues!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Write Your Own Game Engine - Shahriar Shahrabi
Short list of resources and tutorials for writing your own game engine in OpenGl and C++.
Read more >
How I made a DOCUMENTATION WEBSITE for my Game ...
For all your web hosting needs (use coupon code CHERNO for a discount) ▻ https://hostinger.com/chernoPatreon ...
Read more >
Writing a Game Engine from Scratch - Part 1: Messaging
Writing an Engine from scratch can be a daunting task. With a good architectural design and adapted mindset, it is both interesting and ......
Read more >
How to Write Your Own C++ Game Engine
Use an Iterative Approach · Started factoring out vector and matrix functions into my own 3D math library. · Replaced the . ·...
Read more >
Making Your Own Video Game Engine: The Beginners Guide
Learn how to make your own game engine. Determine whether you should build your own game engine and what you need to succeed....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found