Hi all,
I'm writting my first script which I want to use in a Custom Listener (ScriptRunner Listener).
As Event I have to use the issue updated event. Although I only need this for one specific issuetype.
Since this will run in production all the time I asked myself if there are any performance issues to be expected?
Maybe someone have a Listner running on update Issue event and can share his or her experience.
I just queryed for the amount of updated issues. Today about 2000. But it's holiday season ;)
Thanks in advance
Hi Andreas,
This depends on a number of considerations, but mainly:
With regards to the first point, you should be able to limit the amount of computation by writing conditions (depending on your use case). For example: your listener may get invoked 2000 times per day, but maybe you have some code within the listener to check to see if an issue had a particular field updated or if the issue contains a certain Assignee. With that, your listener may only need to do work on a fraction of the 2000 updated issue events.
In most cases, performance isn't a problem. We have users who have incredibly large instances who use listeners with no issue. Unless you're writing an incredibly complex and computationally-expensive listener, you aren't likely to have any problems.
That being said, you'll need to do your own load testing to see if it's performant or not. It's hard to give a definite answer as every situation is likely to be different depending on your use case. Maybe you could try in a staging environment before rolling out to production if you have one?
Regards,
Josh
Hi Joshua Yamdogo @ Adaptavist ,
thanks a lot for your answer.
I read about this condition thing on your site. Is a condition a simple if-clause? Like this one from my code which is called right at the beginning?
if(issue.getIssueTypeId() != '10401'){
return
}
My assumption of 2000 was wrong. My query was jql and I simply made
updated >= startOfDay(-1) AND updated <= endOfDay(-1)
Forgot that any of the 2000 issues could be updated x times.
I defenetly will do that in our dev environment, where everything will be fine due to almost no traffic. But thats exactly my point. How do I know that the script will not cause any performance problems in production.
Anyway, your hint of load testing is very good. We haven't done this and I don't have expirience in that, but will look it up :)
If you can still reply to the condition question. Would be very helpfull.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You're correct about the simple if-clause. Writing those can you help you reduce the amount of work that the listener needs to perform every time it is triggered.
With regards to dev environment testing, that is a good question. You could write a script that simulates thousands of issue updates being executed. For example, we have a script in our Script Library that shows how to update the priority of an issue: https://library.adaptavist.com/entity/update-the-priority-of-an-issue-in-jira
You could try using that in your dev environment within the ScriptRunner Script Console. You could add some code to that script to get every issue in your test project, and then loop through all the issues to update every issue. Set up a listener that listens for the Issue Updated Event and you can test how it runs.
Does that make sense?
Regards,
Josh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.