Skip to content

slow performance when evaluating script detectors #10

@kapil1garg

Description

@kapil1garg

Script detectors for monitored scripts are run for each target every 30 mins. Right now, they run synchronously. In pseudocode:

for monitoredScript in monitoredScripts:
    let computedTargets = monitoredScript.computeTargets();
    for target in computedTargets:
        await runDetectorWIthTarget(monitoredScript.detector, target) // this is blocking

Even with just 4 scripts in DTR, this is already pretty slow to evaluate since detectors need to fetch data from the studio api for each of the orchestration script functions they have in the detector function. One quick way to speed things up would be to generate a list of Promises for all the runDetectorWithTarget(...)'s that would be run and executing them asynchronously using Promise.all

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions