Profiling JIRA ScriptRunner scripts.

Deleted user February 3, 2016

Hi,

We are using several scripts through ScriptRunner in our instance. We are worried that they slow down our instance. Is there a way to profile the scripts? It would be useful to profile the scripts in the entirety (i.e. know how much time the scripts take) but it would be very interesting to get details of the time each methods in the scripts take to run.

Is there a way to do that?

Thank you very much!

3 answers

1 accepted

1 vote
Answer accepted
Chris Solgat
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 3, 2016

If you want to get timings on the scripts within the environment, you will need to add it into the scripts and also enable logging within your scripts (if you haven't already).  We have had to do this and I can certainly attest to the fact that custom scripts can slow down your environment.  There is also documentation as to how you can do testing on your scripts, if you have a newer version of the plugin – Testing your Code.

 

Just curious, are these mostly Scripted Fields, or Post Function type scripts?

Deleted user February 4, 2016

Thanks for your answer! 

Indeed, our scripts are mostly calculations from some fields, the results of which are written into other fields. These scripts are launched as post-functions of certain transitions. However, we have a script that copies issues and this one is REAL slow.

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 4, 2016

In that case it depends whether you need what it does. The slowness, unless you've written it really badly, is just because creating issues is comparatively slow. If you write it as a java plugin, it will be just as slow, but take 10 times longer to write.

Deleted user February 4, 2016

Thanks a lot for the information Jamie!

2 votes
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 3, 2016

This has been covered quite a lot before... things like workflow functions won't have a systemic effect on your instance. If you don't notice it doing the transition, then you don't have a problem.

Recent versions of the plugin record timing and logs:  https://scriptrunner.adaptavist.com/latest/jira/#_logging_and_profiling. If you are using a version before that you can add timing yourself.

But really it depends on what extension points you're using.

1 vote
Thanos Batagiannis _Adaptavist_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 3, 2016

Nicolas and Chris

The latest versions are coming with Logging and Profiling

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events