Jump to content

Flowti Admin Module profiler


LuisM
 Share

Recommended Posts

Hi there,

while developing a sideproject which is completly build with ProcessModules i suddenly had the urge to measure the performance of some modules ? as a result, say welcome to the FlowtiAppPerformance module. 

It comes bundled with a small helper module called FlowtiModuleProfiler. In the first release, even though you could select other modules, it will track the execution of selected Site/ProcessModules. 
This will give you the ability to gain insights how your Application behaves. 

The Main Module itself will come with 2 Logging Options, Database or PW Logs. Select Database for Charts and Logs...well If you just want your profiles as a simple log file in PW. 
You also could choose to dump the request profile into TracyDebugger as shown here:

2024173241_image(2).png.a187c63e36660118b9d6e8df6b2ce962.png

Dont wonder about my avg_sysload, somehow my laptop cant handle multiple VMs that good ?

Settings Screen

532755926_image(3).thumb.png.7cc88ab079acf3b010f3363101f177f5.png

Monitoring

1284118673_image(4).thumb.png.9faeb2372d4351ca636751ce8fb5cb7d.png

FlowtiLogs

917266405_image(5).thumb.png.5c2c47f5fb2a75dbd2ba9305144121ab.png

again, dont look at the sysload ?

I will update the Module in the future to give some filter options and aggregation, but for now it satisfies my needs. 
I hope it is helpfull for some. 

Module is submited to the directory and hosted at github
https://github.com/Luis85/FlowtiAppPerformance

Any suggestions, wishes etc. are much appreciated. 

 

Cheers,

Luis

  • Like 12
Link to comment
Share on other sites

Pushed Version 0.1.1

- added new PageRender Timer (tracks just the page->render() time)
- cleaned Profile Dump
- JavaScript refactored (was a mess before #SundayEvening)
- added new ProfileName Method to avoid duplicate entries


1820782740_image(6).png.d6aa383ecd428acbdd3eeb7431cedae3.png

 

Still TODO

- Filter / Limiting / Aggregation of logged datasets
- more tracking options
- maybe add a webhook to feed other services, will see

Link to comment
Share on other sites

@bernhard Im well aware of profiler-pro ? 

I am a ProcessWire fanboy since 2014 but unfortunatly lost my forums account ? maybe some old veterans remember me. 

Anyways, why do I replicate the pro module you may ask, good question. I have a lot of small PW Instances running for various reasons and dont see the need to purchase a module for my profiling needs. 
Usually my instances are running solely on the ProcessWire Admin because the time I did websites are long gone.
This in mind there are times I want to see how a specific module I my application runs. 

How do I achieve this? 
The core class ProcessController exposes the hookable Method ::execute.
If your site is in Debug=true you already get timers before and after the method call which is totally fine, but once in production I want to avoid setting the site into debug mode just to get these timings.

So we add 2 Hooks to ::execute

$this->addHookBefore("ProcessController::execute", $this, 'startProfiler');
$this->addHookAfter("ProcessController::execute", $this, 'startProfiler');

This gives us also the ability to enrich our profiling with some more data like the requests memory_peak_usage or the avg_sys_load for the last minute. 

These are the 2 values I am the most interested in because they will provide me enough data to see bottlenecks not only on a custom Process Module but also on a specific method. 

For example

 594340674_image(7).thumb.png.b909b10988b0213732e4ea2e487f7418.png

this dataset will give me the opportunity to track down a single method in one Class to inspect the code if there is something fishy. 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 2 weeks later...

@teppo thanks for the mention in the last Weekly, much appreciated ?

I recently pushed a new Version to Github and changed the MarkupTables with DataTables. 

I am well aware that the module isnt that polished someone might expect. I more or less hacked it together to fullfill some very specific needs I had. 
But, I plan to work on it from time to time.

One thing which came to my mind was to integrate the recently published LogStash Module. 
Im always open for suggestions ?

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...