jprofiler. run GC using triggers - triggers

The main task is to make 5 steps in jprofiler using triggers on remote server.
Start recording memory
Wait until end of method usage
Run GC
Stop memory recording
Save snapshot
How Can I run GC using triggers?
In actions jprofiler I got "run script". I tried to put there System.gc() but in UI it doesnt actully saved the script.
Also I tried to export session and manually rewrite part for "RunGC" adding
System.gc() in run script part of config.xml
<runScript>
<script id="1" compiledClassName="" lastModified="0">
<code>System.gc()</code>
</script>
</runScript>

There is a "Run GC" action for triggers in JProfiler.

Related

RobotFrameWork: Is there a way of checking the report.html although the run paused?

Situation: VisualStudioCode (Browser library) runs a couple of .robot files (manually started)
Then it pauses because of an error...
At that point the process breaks and there is no final report.html
If you stop the run it doesn't generate an report.html that's not what you want. You actually want the results until that point. (or even better described: you still want the links output.xml, log.html and report.html)
you should be able to generate lag.htm and report.html using the rebot command. however you need output.xml for this. output.xml is created when you run the tests. when you break you will probobaly not have all the resources you need.
I would suggest to assign test timeout to the test that causes the pause. When the timeout is reached the test will be stoped automaticaly and you should have all reports. You can also set it globaly for all tests eg.:
*** Settings ***
Test Timeout 2 minutes

How to track installer script in a pipeline not executing?

I'm new to the whole Azure DevOps world and just got transferred to a new team that does just that.
One of my assignments is to fix an issue with a pipeline where one of the steps runs a shell script that installs an application. Currently, the step seems to run without any issue shown on the log, but when we connect to the container's pod, the app is not there.
If we run the script directly inside the pod, the application is installed correctly. I'm not sure how to track this. One of the things I've tried was to check the event log to see if there's any error while the installation is executed:Get-Eventlog -LogNmae "Windows PowerShell" -Newest 20, so far no luck here. Again, kinda of new at this, not sure what other tools are out there to track the reason why the script is not installing during the pipeline execution.
To troubleshoot your pipeline run, you can configure your pipeline logs to be more verbose.
1, To configure verbose logs for a single run, you can start a new build by choosing Run pipeline and selecting Enable system diagnostics, Run.
2,To configure verbose logs for all runs, you can add a variable named system.debug and set its value to true.
You can also try logging into your agent server and check for the event log. See this blog for view event log on windows.
The issue was related to how the task was awaited. Adding this piped params helped us solve the issue:
RUN powershell C:\dev\myprocess.ps1 -PassThru | Wait-Process;

Moodle: Scheduled tasks set for one minute sets itself to ASAP, but never reruns

I have been monitoring the Complete learning plans which are due task, which is set to run every minute. I have set the cron.php script with a password to force the cron job to run. When I reload the page I notice that the cron job runs, sets the next run date time, but doesn't run again and changes to ASAP.
I am using Moodle 3.6.3 on Windows IIS.
Create a task in task scheduler to execute the script after every minute (or any time you want). Use "Start a program" action. Replace "C:\Program Files\PHP\v7.2\php-win.exe" with your php version and also change the moodle path to yours.

Protractor - how to run code in browser before angular loads

When running my automation tests I need to run code in my browser before angular is initialised.
I have tried the mockModules approach:
function setupBrowser(){
console.log(`Setting up browser`);
}
browser.addMockModule('someRandomStringNotAModuleName', setupBrowser );
browser.get('myAppUrl');
but I never see the setting up browser message in the browser console. I imagine that this is because I am not trying to mock an angular module, I am just trying to execute code before my app boots.
Is there an alternate way of doing this?
I need to run this code after I have navigated to my angular app but before angular boots because I am listening for start and stop messages from my app. I have a function that waits for stop messages. If there has been no start message it returns immediately.
If I can't run code before angular boots I can't be sure that I have captured all start messages correctly.
Thanks
Your automation tests will not start unless it encounters the onPrepare segment in your configuration file. If you want any code to execute before your browser starts executing your tests, onPrepare is the place to put it.
If you want to execute something before the browser even starts, you will have to add a script that executes the functionality you require and add it to the package.json "script" to execute before your protractor conf.js executes.

Listen for an event in powershell to run a function when a particular program is run?

Is it possible to subscribe to an event in powershell when a particular executable is run?
We have an application that hogs up memory and then causes the system to crash, and if I could attach an event that starts a timer when it starts running and just kills after a certain amount of time, that would fix the issue.
You can use task scheduler to trigger on an Windows Event.Task Scheduler Trigger
Then you can add your powershell script as an action. Even delay the task if you like
As Crusadin sugggests, have a script run when an eventlog entry is made. I have just done the same thing here in work.