Avoid long deployment scanner delay for static content WAR - wildfly

I'm running Wildfly 10, and among many other things my product contains a StaticContent.war, with exactly that - static content (HTML, JS, CSS, images, ...). The size of the WAR is considerable (1700 files, 150MB), and so the deployment scanner (I presume) spends quite some time (10 sec) to scan the file.
Is whatever happens here necessary? Is there a way to avoid this delay?

Related

How to use "Easy edge trace" and "edge trace distances" in ImageJ?

I have already installed the both plugins but don't know how to use them for pod analysis. Need help in that as i don't have programming background. Also can we use it for batch processing of images, in case i have more than 100 images?
Another approach per specially coded ImageJ-macro gives reasonable estimates of the widths and lengths of all pods in the sample image. You can access the macro code from here. Unzip the zip-archive and drop the file "plantPodDimensions.ijm" onto the ImageJ main window. Then open the sample image and run the macro. The estimated pod dimensions appear in a table.
Specimen [right to left] Mean Pod Width [cm] Pod Length [cm]
OHiI7_pod-1 0.70±0.11 23.6
OHiI7_pod-2 0.59±0.09 22.3
OHiI7_pod-3 0.64±0.05 20.7
OHiI7_pod-4 0.41±0.04 20.5
OHiI7_pod-5 0.66±0.07 22.9
OHiI7_pod-6 0.68±0.10 24.4
OHiI7_pod-7 0.60±0.07 20.5
Of course it couldn't be tested, if the macro works as expected for other images than the sample image.
With the download of the plugins come documents that explain the use of the plugins. Batch processing is possible, if the starting points of the traces are known or can somehow be determined by additional pre-processing steps (not trivial). Both plugins are macro-recordable. In any case, batch processing will require some macro code.
For the use case in question I would recommend to perform the analyses via the GUI, not per batch processing. The coding of a suitable macro would take more time than the processing of 100+ images.

Anylogic, using different time unit

I'm having an issue configuring passing time on an Anylogic model: I would like to configure every tick of the model time to be 5 minutes at 1x.
To be clearer, all the things I did were done on the project components shown on the "Projects" tab.
Reading guides and manuals I saw that by clicking on the project root I could configure the time unit in minutes, and this allows me to run it with 1 minute per tick.
I tried to modify the Simulation options setting the "Real-time with scale" at 5, but when I run the experiment it automatically starts at 5x.
Is there any way to achieve my needing?
Thanks a lot.
P
No matter what, the best option to control this, is by doing it programmatically.
getEngine().setRealTimeMode(true); // to be sure you are not using virtual mode
getEngine().setRealTimeScale(5); // 5 would be the 5x, otherwise put a different number
For instance, you can run this at 1x when your model starts (on your "on startup" action on your main properties) and with a button, or after some time, you can change it to whatever you want.

How to find which rule take long time to finish

We have around 15,000 rules running and it takes 2 hours to complete. I would like to figure out which rule takes long time. Its not possible for me to go to each rule and log it. So I implemented the AgendaEventListener and override afterMatchFired() method. I know which rules fired. But how do I know which rule took long time.
If you want the time to execute the match, update your listener to implement the beforeMatchFired method as well. When the beforeMatchFired method triggers, start the timer. When the same rule's afterMatchFired triggers, stop the timer and log it. You'll want to also track match cancelled to discard unnecessary timers.
Remember to track this on a per-rule basis -- you'll need to identify each rule uniquely (package + name should be specific enough). Note that this exercise will get a little complicated if you have rules that extend other rules.
Rather that doing your own profile, you should take a look at the new drools-metric module that solves exactly your problem.
From the manual
Use the drools-metric module to identify the obstruction in your rules
You can use the drools-metric module to identify slow rules especially
when you process many rules. The drools-metric module can also assist
in analyzing the Drools engine performance. Note that the
drools-metric module is not for production environment use. However,
you can perform the analysis in your test environment.
To analyze the Drools engine performance using drools-metric, add
drools-metric to your project dependencies and enable trace logging
for org.drools.metric.util.MetricLogUtils , as shown in the following
example:
Try RulesChronoAgendaEventListener and RulesChronoChartRecorder from da-utils
Both gives you real-time JMX monitoring, showing average and max execution time for each rule. Second gather jfreechart data to show you values in time, which gives you perfect sense of overall performance and 'problematic' cases.
Register session listener
AgendaEventListener rulesChrono = new RulesChronoChartRecorder().withMaxThreshold(500).schedule();
session.addEventListener(rulesChrono);
Print per rule statistic
StringBuilder sb = new StringBuilder();
rulesChrono.getPerfStat().values()
.forEach(s -> sb.append(format("%n%s - min: %.2f avg: %.2f max: %.2f activations: %d", s.getDomain(), s.getMinTimeMs(), s.getAvgTimeMs(), s.getMaxTimeMs(), s.getLeapsCount())));
System.out.println(sb.toString());
Draw charts
Map<String, TimeSeries> rulesMaxChart = rulesChrono.getRulesMaxChart();
Map<String, TimeSeries> rulesMinChart = rulesChrono.getRulesMinChart();
rulesChrono.getRulesAvgChart().entrySet()
.forEach(e -> ChartUtils.pngChart(format("charts/%s.png", e.getKey()), 1024, 500, e.getValue(), Color.black, rulesMaxChart.get(e.getKey()), Color.lightGray, rulesMinChart.get(e.getKey()), Color.lightGray));
For the second you'll need jfreechart dependency

Javaws application is taking long time to launch

I am running javaws application on windows 7 professional with java 1.7u21 it is taking a very long time greater than 1 minute , even launching application is taking a long time about 40 sec means org.eclipse.equinox.launcher.main is using high cpu and taking long time.
As analysed org.eclipse.equinox.launcher.main method is taking much time
Tomcat is also taking very long time even meta-complete is true so scanning is off.
.
Does anyone know why the application is taking such a long time?
I've had a similar issue with webstarting an Eclipse application on Windows. It turned out that the Java system property "user.home" was set to a network drive, this is a known bug. The Eclipse webstart example jnlp's are configured to install the application below the user.home folder. This can take a very long time on a network drive. I solved the issue by creating a custom class WebStartLauncher with a main method that sets user.home to %LOCALAPPDATA% before passing control to the normal Eclipse WebStartMain:
public static void main(String[] args) {
String userProfile = System.getenv("LOCALAPPDATA");
if (userProfile != null) {
System.setProperty("user.home", userProfile);
}
WebStartMain.main(args);
}

No image strip file and no single request with gwts ClientBundle ImageResource

the purpose of gwts clientbundle + imageresource is to reduce the number of http request to one and to minimize the amount of transfered bytes while clientbundle creates a single jpg strip file which contains all my jpg-pics.
As example i have ten pics, clientbundle would put all these ten pics into a single jpg-strip-file
and if the app would call all these images there would be only one http request for the single-jpg-strip file.
thats what i understand.
The thing is that clientbundle is not creating a single strip file.
It creates ten cacheable files but when i am enabling caching it still does not create this single stripfile.
iam understanding something wrong what the purpose of clientbundle is?
There are two small misunderstandings in your question:
ClientBundle will only generate a sprited image for IE6/7; for all other browsers it'll use data: URLs (at least that's the default configuration) until some threshold on the size of the image and then will directly reference the image as an external one (not sprited).
ClientBundle won't generate sprited images (for IE6/7) for images with lossy compression (such as JPEGs), only for those with lossless one (such as PNG or GIF), and only if they're not animated, and only if they're not too big (threshold is controlled by a gwt.imageResource.maxBundleSize system property and defaults to 256 pixels)
In your case, I'd say that the JPEG images cross the threshold so they're not inlined as data: URLs, and because they are JPEG (i.e. with lossy compression) you don't see a sprited image generated either.
Note: there are several threshold actually for the data: URL:
one on the size of the file: https://gwt.googlesource.com/gwt/+/2.5.1/user/src/com/google/gwt/resources/rebind/context/AbstractResourceContext.java
one on the size of the data: URL (after base64-encoding): https://gwt.googlesource.com/gwt/+/2.5.1/user/src/com/google/gwt/resources/rebind/context/InlineResourceContext.java