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

slow performance when evaluating script detectors #10

Open
kapil1garg opened this issue Mar 4, 2022 · 0 comments
Open

slow performance when evaluating script detectors #10

kapil1garg opened this issue Mar 4, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@kapil1garg
Copy link
Contributor

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

@kapil1garg kapil1garg added the bug Something isn't working label Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant