I want to print the execution time taken for each individual Ant target and its dependent targets.
<target name="target1" depends="target2, target3">
....
</target>
When run should show following output
Target 2 - x seconds
Target 3 - y seconds
Target 1 - z seconds
Any suggestions on how to achieve this?
Since Ant 1.8.0 you can use a profilelogger to do this.
ant -logger org.apache.tools.ant.listener.ProfileLogger target
Produces output like
Target aTarget: started Thu Jan 22
09:01:00 CET 2009
echo: started Thu Jan 22 09:01:00 CET
2009
[echo] echo-task
echo: finishedThu Jan 22 09:01:00 CET
2009 (250ms)
zip: started Thu Jan 22 09:01:00 CET
2009
[zip] Building zip: ...\my.zip
zip: finishedThu Jan 22 09:01:01 CET
2009 (1313ms)
Target aTarget: finishedThu Jan 22
09:01:01 CET 2009 (1719ms)
Use one of the listeners from Ant add-on task collections:
antutility
antelope
antcontrib
With -listener net.sf.antcontrib.perf.AntPerformanceListener
Or check their sources, and roll your own listener.
If you're using ant-contrib, then there is a stopwatch task. Put it at the top and bottom of each target and it will report the elapsed and total times.
http://ant-contrib.sourceforge.net/tasks/tasks/index.html
There is the TStamp task that you can use to demark your other tasks.
See here: http://ant.apache.org/manual/Tasks/tstamp.html
There is some extension/addon that will do it all for you without having to do this. Will scrabble around for it if no-one comes up with it first.
Related
Ive been trying to create an apk file for my gluon project. On windows and for windows, the prroject runs perfectly but when in Ubuntu, the commands mvn -Pandroid gluonfx:runagent will run the project but the project wont compile and build.
the error I get keep getting is:
[Wed Jan 04 15:32:35 IST 2023][INFO] We will now compile your code for aarch64-linux-android. This may take some time.[Wed Jan 04 15:33:01 IST 2023][INFO] Additional information: Objectfile should be called com.gluonapplication.mobiletrial1.o but we didn't find that under /mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/aarch64-android/gvm[Wed Jan 04 15:33:01 IST 2023][SEVERE] Compiling failed.Check the log files under /mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/aarch64-android/gvm/logAnd please check https://docs.gluonhq.com/ for more information.[INFO] ------------------------------------------------------------------------[INFO] BUILD FAILURE[INFO] ------------------------------------------------------------------------[INFO] Total time: 45.283 s[INFO] Finished at: 2023-01-04T15:33:01+05:30[INFO] ------------------------------------------------------------------------[ERROR] Failed to execute goal com.gluonhq:gluonfx-maven-plugin:1.0.15:compile (default-cli) on project mobiletrial1: Compiling failed -> [Help 1]
The log file
[Wed Jan 04 16:48:54 IST 2023][FINE] PB Command for compile: /mnt/c/Java/linux/graalvm-svm-java17-linux-gluon-22.1.0.1-Final/bin/native-image -Djdk.internal.lambda.eagerlyInitialize=false --no-server -H:+SharedLibrary -H:+AddAllCharsets -H:+ReportExceptionStackTraces -H:-DeadlockWatchdogExitOnTimeout -H:DeadlockWatchdogInterval=0 -H:+RemoveSaturatedTypeFlows -H:+ExitAfterRelocatableImageWrite --features=org.graalvm.home.HomeFinderFeature -H:TempDirectory=/mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/aarch64-android/gvm/tmp -H:EnableURLProtocols=http,https --initialize-at-build-time=com.gluonhq.charm.glisten.visual.MaterialDesignIcon -H:ReflectionConfigurationFiles=/mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/aarch64-android/gvm/reflectionconfig-aarch64-android.json -H:JNIConfigurationFiles=/mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/aarch64-android/gvm/jniconfig-aarch64-android.json -H:ResourceConfigurationFiles=/mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/aarch64-android/gvm/resourceconfig-aarch64-android.json -H:-SpawnIsolates -Dsvm.targetArch=aarch64 -H:+ForceNoROSectionRelocations --libc=bionic -H:+UseCAPCache -H:CAPCacheDir=/mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/aarch64-android/gvm/capcache -H:CompilerBackend=lir -H:IncludeResourceBundles=com/sun/javafx/scene/control/skin/resources/controls,com/sun/javafx/scene/control/skin/resources/controls-nt,com.sun.javafx.tk.quantum.QuantumMessagesBundle -Dsvm.platform=org.graalvm.nativeimage.Platform$LINUX_AARCH64 -cp /home/vatsal/.m2/repository/com/gluonhq/substrate/0.0.55/substrate-0.0.55.jar:/mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/aarch64-android/gvm/tmp/classpathJar.jar com.gluonapplication.MobileTrial1
[Wed Jan 04 16:48:54 IST 2023][FINE] Start process compile...
[Wed Jan 04 16:48:54 IST 2023][FINE] Result for compile: 0
[Wed Jan 04 16:48:54 IST 2023][FINE] Logging process [compile] to file: /mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/log/process-compile-1672831134641.log
[Wed Jan 04 16:48:54 IST 2023][INFO] Additional information: Objectfile should be called com.gluonapplication.mobiletrial1.o but we didn't find that under /mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/aarch64-android/gvm
[Wed Jan 04 16:48:54 IST 2023][SEVERE] Compiling failed.
Check the log files under /mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/aarch64-android/gvm/log
And please check https://docs.gluonhq.com/ for more information.
gluonfx log file
Process
=======
compile
Command Line
============
/mnt/c/Java/linux/graalvm-svm-java17-linux-gluon-22.1.0.1-Final/bin/native-image -Djdk.internal.lambda.eagerlyInitialize=false --no-server -H:+SharedLibrary -H:+AddAllCharsets -H:+ReportExceptionStackTraces -H:-DeadlockWatchdogExitOnTimeout -H:DeadlockWatchdogInterval=0 -H:+RemoveSaturatedTypeFlows -H:+ExitAfterRelocatableImageWrite --features=org.graalvm.home.HomeFinderFeature --features=com.gluonhq.substrate.feature.GluonFeature -H:TempDirectory=/mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/x86_64-linux/gvm/tmp -H:EnableURLProtocols=http,https -H:ReflectionConfigurationFiles=/mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/x86_64-linux/gvm/reflectionconfig-x86_64-linux.json -H:JNIConfigurationFiles=/mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/x86_64-linux/gvm/jniconfig-x86_64-linux.json -H:ResourceConfigurationFiles=/mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/x86_64-linux/gvm/resourceconfig-x86_64-linux.json -H:IncludeResourceBundles=com/sun/javafx/scene/control/skin/resources/controls,com/sun/javafx/scene/control/skin/resources/controls-nt,com.sun.javafx.tk.quantum.QuantumMessagesBundle -Dsvm.platform=org.graalvm.nativeimage.Platform$LINUX_AMD64 -cp /home/vatsal/.m2/repository/com/gluonhq/substrate/0.0.55/substrate-0.0.55.jar:/mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/x86_64-linux/gvm/tmp/classpathJar.jar com.gluonapplication.MobileTrial1
Output
======
Result
======
result: 0
I have tried uninstalling and reinstalling ubuntu and wsl and I have tried the same process on Linux and have got the same error.
I'm trying to use highcharts-export-server in command-line/batch mode. I've installed the latest version (2.0.28). I'm running Windows 10 with Node 12.
I'm running it from the command line using the following command:
highcharts-export-server --nologo 1 --logLevel 4 --options chart.json --outfile chart.png --type png --width 500
The console output says:
starting highcharts export server v2.0.28...
Fri Sep 25 2020 15:07:48 GMT+0100 (British Summer Time) [verbose] attaching exit listeners to the process..
Fri Sep 25 2020 15:07:48 GMT+0100 (British Summer Time) [verbose] Pool started:
maxWorkers: 1
initialWorkers: 1
workLimit: 60
listening to process exit: true
Fri Sep 25 2020 15:07:48 GMT+0100 (British Summer Time) [verbose] phantom 1 - spawning worker
Fri Sep 25 2020 15:07:48 GMT+0100 (British Summer Time) [verbose] starting export
Fri Sep 25 2020 15:07:48 GMT+0100 (British Summer Time) [verbose] attempting to export from raw input
Fri Sep 25 2020 15:07:48 GMT+0100 (British Summer Time) [verbose] phantom - received work, finding available worker
Fri Sep 25 2020 15:07:48 GMT+0100 (British Summer Time) [verbose] phantom - found available worker
Fri Sep 25 2020 15:07:48 GMT+0100 (British Summer Time) [verbose] phantom 1 - starting work
Fri Sep 25 2020 15:07:52 GMT+0100 (British Summer Time) [notice] phantom worker 1 finished work ??? in 3562 ms
Fri Sep 25 2020 15:07:52 GMT+0100 (British Summer Time) [notice] phantom worker 1 - process was closed
Fri Sep 25 2020 15:07:52 GMT+0100 (British Summer Time) [notice] terminating, killing all running phantom processes
...but although a chart.png file is created and has the correct width, it's blank (transparent):
This is the content of the chart.json file, which I took from one of the examples on the Highcharts website:
{
chart: {
type: 'bar'
},
title: {
text: 'Fruit Consumption'
},
xAxis: {
categories: ['Apples', 'Bananas', 'Oranges']
},
yAxis: {
title: {
text: 'Fruit eaten'
}
},
series: [{
name: 'Jane',
data: [1, 0, 4]
}, {
name: 'John',
data: [5, 7, 3]
}]
}
Note: I'll mention that when I first tried to install highcharts-export-server I hit a different problem which was that I couldn't run it at all (it failed with uncaughtException: TypeError: "file" argument must be a non-empty string). After some googling I found some blog posts suggesting that I needed to install PhantomJS first, and to use the --unsafe-perm option. So, the commands I actually used to install it was:
npm install phantomjs --unsafe-perm
npm install highcharts-export-server --unsafe-perm
Oh, and it wasn't until some time later that I realised I might have to install Highcharts itself :-) So I did that too (npm install highcharts), but it didn't actually seem to make a difference.
In case this helps anyone else, here is the full conversation about this issue on the Highcharts Forum.
In summary, it turned out that the NPM package was improperly installed (due to a firewall issue).
This wasn't apparent from the installation logs, but the effect was that in the node_modules/highcharts/export-server/phantom/export.html file there was a script block that should have contained minified JavaScript but that actually contained only lines saying undefined;.
The fix in my case (to work around the firewall issue) was to specify an http URL for the CDN when installing Highcharts Export Server, rather than the default URL which uses https. Once I'd done that, the export.html did contain the minified JS code, and the tool worked correctly.
I am looking for a model for text classification for our log notes analytics.
The challenge is that each note may contain none 'natural language' texts. For example, some notes are thread backtrace output with symbols, some notes are logging information from source code. And among these notes, some notes with description of how customer is using our product are the ones we want to classify.
Is there any ML model or approach that I could use for this text classification?
Below are some examples for different notes (I changed some content so no company confidential materials are shown):
backtrace info developer pasted for bug analysis:
func118 4563453 344 = SYSTEM_FUNC_1 0x00000efa34343 0x0000000009f333a0 0xffe3ebdfd700 <<<<<
Total of 1 API working thread(s)
(gdb) thread find 0x123456
Thread 670 has target id 'Thread 0x123456 (LWP 443)'
(gdb) t 670
[Switching to thread 670 (Thread 0x123456 (LWP 443))]
#0 0x35353453563abcd in __lock_func1_ ()
from /disks/folder1/xxx/xxx_folder1/info_folder/info2_dir/lib64/libpthread.so.0
(gdb) ebt
#0 __lock_func1_()
#1 _LOCK_F_10()
#2 func_mod_4()
#3 func_mod_5()
#4 ModCon::disconnect()
#5 ModCon::abort()
#6 ModServ::disconnect()
#7 ModServManager::disconnect()
#8 mod1::func1()
#9 mod1::func2()
Product log for issue analysis:
cpu/MOD/MOD2/log/
start_mod.log:
Thu Dec 24 00:01:12 UTC 2019 FUN: HG: FILE_A: stopping
Thu Dec 24 00:01:12 UTC 2019 FUN: FILE_A: stopping, timeout -22-
Thu Dec 24 00:01:12 UTC 2019 system-state: cleared FILE_A_start_complete
Thu Dec 24 00:01:12 UTC 2019 FUN: FILE_A: run thread still running: con_b.pl FUN_run 0
Thu Dec 24 00:01:12 UTC 2019 FUN: FILE_A: calling con_b.pl FUN_cleanup 0, time left: -160-
Thu Dec 24 00:01:12 2019 cli: con_a.pl: FUN_cleanup for FILE_A
Thu Dec 24 00:01:12 2019 cmd: con_a.pl: sp got xxx error, will try to act_xxx
Thu Dec 24 00:01:13 UTC 2019 FUN: FILE_A: action 1
Thu Dec 24 00:01:13 UTC 2019 FUN: FILE_A: action 1 complete
Thu Dec 24 00:01:13 UTC 2019 FUN: FILE_A: action 2
Customer related infomation for configuration (which will be most interested notes that I want to classify and retreive from all notes):
Customer xxx has created func_xxx to protect their data,
they also perform daily backup of their data by using func_xxx2.
They totally created xxx3 objects in each node...
I had scheduled pulling in Jenkins every 5 minutes: */5 * * * *.
I committed changes to SVN, I can see them in SVN history (logs).
Jenkins starting the build, but it shows: Revision: x
No changes. And everything what was configured is running.
After 5 minutes Jenkins starts another run, with message: Revision: x+1
Changes
just for test Jenkins deploy (detail)
by UserName
After, for test purposes I have changed to * * * * * to run every minute, and the results were such:
Jenkins runs:
Success > Console Output#176 Nov 29, 2018 2:14 PM
Success > Console Output#175 Nov 29, 2018 2:13 PM
Success > Console Output#174 Nov 29, 2018 2:11 PM
Success > Console Output#173 Nov 29, 2018 2:10 PM
Success > Console Output#172 Nov 29, 2018 2:09 PM
Success > Console Output#171 Nov 29, 2018 2:08 PM
Success > Console Output#170 Nov 29, 2018 2:07 PM
Success > Console Output#169 Nov 29, 2018 2:06 PM
---Commit goes here
Success > Console Output#168 Nov 29, 2018 1:01 PM
from 2.06 he see that there is changes, he run job, but it really didn't see what changes was there, and only at 2:14 it wrote SVN commit message.
also in Recent Changes logs:
Changes
176 (Nov 29, 2018 2:14:19 PM)
just for test Jenkins deploy — UserName / detail
168 (Nov 29, 2018 1:01:36 PM)
It is strange behavior, could someone have idea, where could be the issue?
Based on the conversation, We have found out the culprit was the Time Difference of the 2 servers(Jenkins and SVN) approx 7-8 mins was the issue.
Why does this happen ?
Jenkins realized that a new version was available, but couldn't check it out
as long as its own time was smaller than the new versions time.
A similar issue is described here:
Why up-to-date files committed to SVN will not be immediately pulled out by Hudson to build
Environment: Linux/Windows7, Java 1.6.0.03/37 or 1.7
I downloaded jenkins.war and after the initial setup using the following script/command, I downloaded some plugins(10-15) and tried to restart Jenkins, it worked. Then, I got some more plugins (30-40 in total) and either I chose Install or download+then+install, Jenkins didn't come up.
i.e. using startJenkins.sh (Linux only). Note: On Windows7 Jenkins started as a Windows service.
#!/bin/bash
export JAVA_HOME=/production/jenkinsAKS/java/jdk1.6.0_03
export JENKINS_HOME=/production/jenkinsAKS
export PATH=${JAVA_HOME}/bin:${PATH}
export JENKINS_HTTP_PORT=9040
export JENKINS_AJP13_PORT=9949
now=`date +%Y%m%d_%H%M%S`
echo $0 begins ${now}
echo " java-home=${JAVA_HOME}, jenkins-home=${JENKINS_HOME}, path=${PATH}"
java -jar ${JENKINS_HOME}/lib/jenkins.war -XX:MaxPermSize=4096m --logfile=${JENKINS_HOME}/log/jenkins.log${now} --httpPort=${JENKINS_HTTP_PORT} --ajp13Port=${JENKINS_AJP13_PORT} &
Initially I didn't use "-XX:MaxPermSize=4096m" parameter but as soon as I saw the following error message, I tried various values like 128/512/1024,2048,4096m etc, didn't help with the error.
INFO: Beginning extraction from war file
Jenkins home directory: /production/jenkinsAKS found at: EnvVars.masterEnvVars.get("JENKINS_HOME")
Aug 1, 2013 1:17:15 PM winstone.Logger logInternal
INFO: HTTP Listener started: port=9040
Aug 1, 2013 1:17:15 PM winstone.Logger logInternal
INFO: AJP13 Listener started: port=9949
Aug 1, 2013 1:17:15 PM winstone.Logger logInternal
INFO: Winstone Servlet Engine v0.9.10 running: controlPort=disabled
Aug 1, 2013 1:17:16 PM jenkins.InitReactorRunner$1 onAttained
INFO: Started initialization
Aug 1, 2013 1:17:16 PM jenkins.InitReactorRunner$1 onAttained
INFO: Listed all plugins
Aug 1, 2013 1:17:16 PM hudson.plugins.ansicolor.PluginImpl start
INFO: AnsiColor: eliminating boring output (https://github.com/dblock/jenkins-ansicolor-plugin)
Aug 1, 2013 1:17:16 PM org.jvnet.hudson.plugins.backup.BackupPluginImpl loadConfiguration
INFO: Loading configuration...
Aug 1, 2013 1:17:16 PM org.jvnet.hudson.plugins.backup.utils.BackupPersistence loadConfig
INFO: Config file not found.
Aug 1, 2013 1:17:18 PM ruby.RubyRuntimePlugin start
INFO: Injecting JRuby into XStream
Trying to load models from /production/jenkinsAKS/plugins/pathignore/WEB-INF/classes/models
Loading /production/jenkinsAKS/plugins/pathignore/WEB-INF/classes/models/pathignore_wrapper.rb
Aug 1, 2013 1:17:26 PM hudson.plugins.greenballs.PluginImpl start
INFO: Green Balls!
Aug 1, 2013 1:17:26 PM jenkins.InitReactorRunner$1 onAttained
INFO: Prepared all plugins
Aug 1, 2013 1:17:32 PM hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1 error
WARNING: Failed to instantiate optional component org.jfrog.hudson.ivy.ArtifactoryIvyConfigurator$DescriptorImpl; skipping
Aug 1, 2013 1:17:32 PM jenkins.InitReactorRunner$1 onAttained
INFO: Started all plugins
Aug 1, 2013 1:17:32 PM jenkins.InitReactorRunner$1 onAttained
INFO: Augmented all extensions
Aug 1, 2013 1:17:32 PM jenkins.InitReactorRunner$1 onAttained
INFO: Loaded all jobs
Aug 1, 2013 1:17:32 PM hudson.plugins.scm_sync_configuration.ScmSyncConfigurationBusiness queueChangeSet
INFO: Queue of changeset A hudson.model.UpdateCenter.xml
aborted (scm manipulator not settled !)
Aug 1, 2013 1:17:32 PM org.jenkinsci.main.modules.sshd.SSHD start
INFO: Started SSHD at port 36227
Aug 1, 2013 1:17:32 PM jenkins.InitReactorRunner$1 onAttained
INFO: Completed initialization
Aug 1, 2013 1:17:32 PM hudson.TcpSlaveAgentListener <init>
INFO: JNLP slave agent listener started on TCP port 46056
The following triggers are available for your jobs
[Trigger] - Build periodically
[Trigger] - Build when another project is promoted
[Trigger] - Maven Dependency Update Trigger
[Trigger] - Poll SCM
[Trigger] - [BuildResultTrigger] - Monitor build results of other jobs
[Trigger] - [FSTrigger] - Monitor files
[Trigger] - [FSTrigger] - Monitor folder
[Trigger] - [IvyTrigger] - Poll with an Ivy script
[Trigger] - [ScriptTrigger] - Poll with a Groovy script
[Trigger] - [ScriptTrigger] - Poll with a shell or batch script
[Trigger] - [URLTrigger] - Poll with a URL
Aug 1, 2013 1:17:33 PM hudson.WebAppMain$2 run
INFO: Jenkins is fully up and running
Exception in thread "Jenkins cron thread" java.lang.OutOfMemoryError: PermGen space
Exception in thread "JmDNS(sagrdev3sb12.local.).State.Timer" java.lang.OutOfMemoryError: PermGen space
Exception in thread "ConnectorThread:[http-9040]" java.lang.OutOfMemoryError: PermGen space
Exception in thread "JmDNS(sagrdev3sb12.local.).Timer" java.lang.OutOfMemoryError: PermGen space
Exception in thread "WinstoneHostConfigurationMgmt:default" java.lang.OutOfMemoryError: PermGen space
or sometimes I see:
30 Aug 1, 2013 1:50:29 AM jenkins.InitReactorRunner$1 onAttained
31 INFO: Prepared all plugins
32 Exception in thread "pool-2-thread-20" java.lang.OutOfMemoryError: PermGen space
33 Aug 1, 2013 1:51:10 AM winstone.Logger logInternal
34 WARNING: Untrapped Error in Servlet
35 java.lang.OutOfMemoryError: PermGen space
36 Aug 1, 2013 1:51:12 AM winstone.Logger logInternal
37 SEVERE: Error in the error servlet
38 java.lang.OutOfMemoryError: PermGen space
39 Exception in thread "Jenkins cron thread" java.lang.OutOfMemoryError: PermGen space
-bash-3.2$
How can I resolve this issue? The same issue came up when I did the same exercise on my Windows desktop machine. Do I need to use less or a limited number of plugins?
Thanks
In my ~/.bash_profile file, I have set the following 3 variables. Note there are other variables in this file as well i.e. JAVA_HOME, ANT_HOME, SONAR_HOME, SONAR_RUNNER_HOME, etc:
export JAVA_OPTS="-XX:MaxPermSize=512m -Xms512m -Xmx1024m"
export GRADLE_OPTS="-XX:MaxPermSize=512m"
export SONAR_RUNNER_OPTS="-Xmx512m -XX:MaxPermSize=512m"
All - working now.
The first export line: will get Jenkins going without PermGen error, the 2nd line will make Gradle going when Jenkins calls Gradle script (via a another wrapper script for ex. .sh/etc), third line makes "sonar-runner" command to work fine (otherwise, I was getting an error for PermGen after "Initialize Hibernate"... line during sonar-runner command's output). You run sonar-runner command in the workspace where you have compiled java, reports related to static code analysis tools (pmd/checkstyle/findbugs) and other code coverage reports (jacoco/cobertura). Workspace should have "sonar-project.properties" file. Look for SonarQube help pages about this file and what all variables it contains for a project.
All those options are documented here:
http://docs.oracle.com/javase/8/docs/technotes/tools/windows/java.html
or here if you are using Java 7:
http://docs.oracle.com/javase/7/docs/technotes/tools/windows/java.html
IF you are using Gradle, You can set the -Xmx or -XX:MaxPermSize by adding a GRADLE_OPTS global environment variable in the Jenkins global configuration. To do this, click Manage Jenkins, then Configure System. In the Global properties section, click the Environment Variables checkbox, then add a new environment variable called GRADLE_OPTS with the value set appropriately as below:
name: GRADLE_OPTS
value: -Xmx1024m -XX:MaxPermSize=1024m
where 1024 is memory specified. You can change it as per your requireent.
Similar configuration is needed for Maven. Please see the link below for more details:
https://wiki.jenkins-ci.org/display/JENKINS/Builds+failing+with+OutOfMemoryErrors