byteman

Importing multiple rules files


I have some byteman rules files. To load them:

  1. Either I put all the rules in a single file or load that file OR
  2. Individually load load files. OR
  3. While submitting provide multiple files (space separated).

Is there any way that I still keep the rules in separate files but load them with a single command by loading a file X having references to all the Rule files ?

Also, is is safe to load multiple files with separate commands at the same time ?


Solution

  • Is there any way that I still keep the rules in separate files but load them with a single command by loading a file X having references to all the Rule files ?

    No, Byteman does not provide a way to do list rule scripts via some other file.

    Also, is is safe to load multiple files with separate commands at the same time ?

    Yes, normally it is safe to do this. However there are a few small caveats that apply.

    Rules are submitted by opening a socket and posting a request. Socket requests are handled by a single listener thread which accepts and processes each rule upload (or removal) one at a time so each update happens atomically. There is no possibility of different requests getting confused. However, if you were to try to send a very large number of requests in parallel it is possible that a socket open requests could time out because 1) the listener was busy processing all the other requests or 2) the socket incoming request queue was full.

    A second consideration is whether your rules are able to operate correctly in isolation or in arbitrary sequence rather than applied as a batch in order of submission. When multiple rules are submitted in one submit request the order of application is determinate and the class transformations needed to inject the rules all happen as a single update rather than as a series of incremental changes. If your rules depend on each other to achieve the desired side-effects then these two properties may be important. Whether that is the case depends on what your rules are doing and how they might interact.