How to use Stopwatch / Timer Plugin by AirDev?

@vlad,

I’m trying to use the Stopwatch / Timer plugin to analyze why some of my workflows are so slow. Sorry, but I can’t figure out what to do with it.

In the docs (plugin page), I don’t see anything about where the times are stored or how to retrieve and use them. Nevertheless, through experimentation I think I learned that the plugin returns three custom state values: Lap Times, Duration and Lap Names.

image

There’s no way to know what data type these are but though more experimentation I came to believe that Lap Times and Lap Names are lists of Number and Text respectively. I haven’t bothered to find out what Duration is. I’m only concerned with times associated with individual workflow actions that, I hope, correspond to laps.

Since these are custom states, and I don’t want to stop the workflow that’s being timed, I attempted to write them to a log file that looks like this:
image

The log is written via an API workflow with this interface:

and this action:
image

What got written to the log file is empty:

I have clearly reached the limits of my understanding of Bubble and the Stopwatch / Timer plugin.

Can you help me understand how to use this? I really need to improve the speed of some workflows and right now I’m flying blind.

Hello @laurence,

Thanks for giving this plugin a try and for giving this feedback. I’d like to apologize for the lack of maintenance on this plugin - we haven’t used it at AirDev for over a year and really just used it to speed up one DB write-heavy app.

Check out this test page
located in this test app. which I just added to the plugin’s documentation, and theupdated plugin documentation. You can see how long certain actions take within this test app, as well as see how to use the fields Lap Times, Lap Names, Duration, and a new isRunning field I just added.

The page “test” in that app has less workflows and might be easier to read, if less useful to see the different use cases for the plugin.

Currently the timer doesn’t display a time that counts up as you’re waiting for actions to complete. Its intended to be run at specific points in stubborn workflows to see which steps are taking a long time, or to see how long an entire action takes to run.

Hope this is helpful and let me know if you have any questions. Not sure how to help you on that API workflow you posted with the logging, but on this test page the log action never fails to update the log name and log time when the log action is run.

Best,
Chris

1 Like

Thanks, @andersan.

I’ll study the test app.

1 Like

@laurence
You might want to build your own

Check out this editor by @NigelG

I tweaked it a bit

timer

If you go into the editor you could easily see how to create this…one thing that I did to get the numbers to show as 07 instead of 7 was set a conditional on the text

2 Likes

Looks good. Thanks. I’ll be applying this to my app very soon.

1 Like

Is there a way, instead of countdown start from 0:00:00 and then go to when a user exits?

I don’t understand your question. The countdown does not start at 0:00:00 it counts down to 0:00:00

What he meant was instead of a countdown , a stopwatch. So stopwatch starting from 00:00:00. This is a thread about a stopwatch not a countdown.

To do that just set up a custom state to be number, then set a text to show the number, then do a workflow to update every x seconds

Yes that’s what I did. Using workflow to tick the clock , do you think that could be taxing to the server?

Anytime you run a workflow it uses some capacity