Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#849: Integration of gcviewer #862

Merged
merged 42 commits into from
Sep 9, 2022
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
1bb277b
#810: Integration of Openshift
ahmedagdmoun Aug 22, 2022
6885f65
devonfw#810: Added documentation according to DoD guidelines
Akuhana Aug 22, 2022
64ff005
#810: added major version for the download url
ahmedagdmoun Aug 23, 2022
da7489a
Merge branch 'feature/oc' of https://github.com/ahmedagdmoun/devonfw-…
ahmedagdmoun Aug 23, 2022
4041cbe
#810 Openshift Integration #854: fixed shellcheck issues
ahmedagdmoun Aug 23, 2022
393477e
#849: Integration of gcviewer
ahmedagdmoun Aug 24, 2022
a7e83c4
#849: fixed some issues concerning MacOS
ahmedagdmoun Aug 24, 2022
1b6f845
#849: fixed some issues concerning MacOS
ahmedagdmoun Aug 24, 2022
e79eb5b
#849: fixed some issues with MacOS
ahmedagdmoun Aug 24, 2022
8d182de
#849: minor changes
ahmedagdmoun Aug 24, 2022
daae3c7
#849: Integration for Linux
ahmedagdmoun Aug 25, 2022
78d5207
#849: fixed JAR file name for Linux
ahmedagdmoun Aug 25, 2022
23d98ab
#849: documentation and other changes according to DoD
ahmedagdmoun Aug 25, 2022
898987a
#849: Updates following to DoD
ahmedagdmoun Aug 26, 2022
613fc90
#849: removed unnecessary code
ahmedagdmoun Aug 26, 2022
8c63e16
#849: updated asciidoc, functions & gcviewer script
ahmedagdmoun Aug 30, 2022
ca1c2e7
#849: updated
ahmedagdmoun Aug 30, 2022
00037b8
updated oc script
ahmedagdmoun Aug 30, 2022
3203a65
Resolving merge conflicts
ahmedagdmoun Aug 30, 2022
7dff5fa
Solving Merge Conflicts
ahmedagdmoun Aug 30, 2022
94f7be0
Merge remote-tracking branch 'upstream/master' into feature/gcviewer
ahmedagdmoun Aug 30, 2022
149f98c
#849: updated CHANGELOG.asciidoc
ahmedagdmoun Aug 30, 2022
8b71326
#849: fixed shellcheck errors
ahmedagdmoun Aug 30, 2022
397469e
#849: fixed shellcheck errors
ahmedagdmoun Aug 30, 2022
21f7245
Merge branch 'devonfw:master' into feature/gcviewer
ahmedagdmoun Sep 6, 2022
ec0e015
#849: changes according to PR #862 's review
ahmedagdmoun Sep 6, 2022
9f5c4ea
Merge branch 'feature/gcviewer' of https://github.com/ahmedagdmoun/de…
ahmedagdmoun Sep 6, 2022
7e75dbe
#849: changes according to PR #862 's review
ahmedagdmoun Sep 6, 2022
16f2708
Merge branch 'master' into feature/gcviewer
ahmedagdmoun Sep 8, 2022
5367d1d
trying to revert phantom change.
hohwille Sep 9, 2022
9109277
trying to revert phantom change.
hohwille Sep 9, 2022
fa0d40d
trying to revert phantom change.
hohwille Sep 9, 2022
63152d0
trying to revert phantom change.
hohwille Sep 9, 2022
296b673
trying to revert phantom change.
hohwille Sep 9, 2022
5b3ac6b
trying to revert phantom change.
hohwille Sep 9, 2022
454f2a1
trying to revert phantom change.
hohwille Sep 9, 2022
5d16191
reverting undesired change
hohwille Sep 9, 2022
4e545f1
Merge branch 'master' into feature/gcviewer
hohwille Sep 9, 2022
82d5c1c
#862: constructive review
hohwille Sep 9, 2022
640d585
Merge branch 'master' into feature/gcviewer
hohwille Sep 9, 2022
397a9ea
#862: fixed setup
hohwille Sep 9, 2022
a399416
#862: fixed launch script
hohwille Sep 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ New release with various improvements and bugfixes:
* https://github.com/devonfw/ide/issues/800[#800]: Nightly test with additional tests
* https://github.com/devonfw/ide/issues/767[#767]: Fix AsciiDoc issues
* https://github.com/devonfw/ide/issues/774[#774]: Create Getting-Started-For-Developers Documentation
* https://github.com/devonfw/ide/issues/849[#849]: Integration of GCViewer

The full list of changes for this release can be found in https://github.com/devonfw/ide/milestone/31?closed=1[milestone 2022.08.001].

Expand Down
1 change: 1 addition & 0 deletions documentation/cli.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ The following commandlets are currently available:
* link:docker.asciidoc[docker]
* link:dotnet.asciidoc[dotnet]
* link:eclipse.asciidoc[eclipse]
* link:gcviewer.asciidoc[gcviewer]
* link:graalvm.asciidoc[graalvm]
* link:gradle.asciidoc[gradle]
* link:helm.asciidoc[helm]
Expand Down
2 changes: 2 additions & 0 deletions documentation/devonfw-ide-usage.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ include::dotnet.asciidoc[leveloffset=3]

include::eclipse.asciidoc[leveloffset=3]

include::gcviewer.asciidoc[leveloffset=3]

include::graalvm.asciidoc[leveloffset=3]

include::gradle.asciidoc[leveloffset=3]
Expand Down
25 changes: 25 additions & 0 deletions documentation/gcviewer.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
:toc:
toc::[]

= GCViewer

The `gcviewer` commandlet is used to install the GCViewer App if not already installed or launch the App if already installed.
GCViewer is a little tool that visualizes verbose GC (Garbage Collection) output generated by Java Virtual Machines.
To learn more about GC Loggings, please refer to https://sematext.com/blog/java-garbage-collection-logs/ or https://www.baeldung.com/java-gc-logging-to-file.

*ATTENTION:*
Currently this feature is new and therefore experimental.
It may change in incompatible ways in the next releases until we reach a stable state.
We hope that all is working fine for you.
However, do not expect everything to work out of the box.


The arguments (`devon gcviewer «args»`) are explained in the following table:

.Usage of `devon gcviewer`
[options="header"]
|=======================
|*Argument(s)* |*Meaning*
|`setup` |install the latest version of GCViewer on your machine.
|`start` |launch the GCViewer App.
|=======================
1 change: 1 addition & 0 deletions documentation/scripts.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This directory is the heart of the `devonfw-ide` and contains the required link:
│ ├── link:docker.asciidoc[docker]
│ ├── link:dotnet.asciidoc[dotnet]
│ ├── link:eclipse.asciidoc[eclipse]
│ ├── link:gcviewer.asciidoc[gcviewer]
│ ├── link:graalvm.asciidoc[graalvm]
│ ├── link:gradle.asciidoc[gradle]
| ├── link:helm.asciidoc[helm]
Expand Down
91 changes: 91 additions & 0 deletions scripts/src/main/resources/scripts/command/gcviewer
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#!/usr/bin/env bash

# autocompletion list
if [ "${1}" = "shortlist" ]
then
if [ -z "${2}" ]
then
echo "setup start help"
fi
exit
fi

if [ -n "${DEVON_IDE_TRACE}" ]; then set -vx; fi
# shellcheck source=scripts/functions
source "$(dirname "${0}")"/../functions

GCVIEWER_HOME="${DEVON_IDE_HOME}/software/gcviewer"

# gcviewer installation
function doSetup(){

if [ "${1}" != "silent" ]
then
if [ -z "${GCVIEWER_VERSION}" ]
then
doEcho "Getting the latest release of GCViewer..."
GCVIEWER_VERSION=$(curl "https://github.com/chewiebug/GCViewer/tags" | awk -F "/tag/" '/GCViewer/ {print $2}' | sort -r | head -1 | awk -F "\">" '{print $1}')
fi
do_not_extract="Not Empty"
doInstall "-" "${GCVIEWER_HOME}" "gcviewer" "${GCVIEWER_VERSION}" "" "" "" "" "" "" "${do_not_extract}"
doCreateGCViewerScript
fi

}

function doStart(){

if [ ! -d "${GCVIEWER_HOME}" ]
then
doSetup
else
hohwille marked this conversation as resolved.
Show resolved Hide resolved
cd "${GCVIEWER_HOME}" || exit
doDevonCommand java setup silent
doEcho "Starting GCViewer..."
doRunGCViewer
fi

}

doCreateGCViewerScript(){

cd "${GCVIEWER_HOME}" || exit
touch gcviewer-script
echo -e "#!/usr/bin/env bash\n\njava -jar gcviewer*.jar&" >> gcviewer-script
chmod +x gcviewer-script

}

doRunGCViewer(){

cd "${GCVIEWER_HOME}" || exit
gcviewer-script

}


# CLI
case ${1} in
"help" | "-h")
echo "Setup or run gcviewer"
echo
echo "Arguments:"
echo " setup install the latest version GCViewer on your machine."
echo " start launch GCViewer App."
echo
;;
"setup" | "s")
if [ "${2}" == "silent" ]
then
doSetup silent
else
doSetup
fi
;;
"start" | "")
doStart
;;
*)
doError "Unkown command!"
;;
esac
16 changes: 12 additions & 4 deletions scripts/src/main/resources/scripts/functions
Original file line number Diff line number Diff line change
Expand Up @@ -1146,6 +1146,7 @@ function doGitPullOrClone() {
# $8: optional architecture (e.g. x86_64)
# $9: optional extension (e.g. 'tar.gz' or 'zip')
# $10: optional software repo
# $11: optional to ignore extracting downloaded files (must not be empty to ignore extracting!)
function doInstall() {
local url="${1}"
local target_path="${2}"
Expand All @@ -1157,6 +1158,7 @@ function doInstall() {
local arch="${8}"
local ext="${9}"
local repository="${10}"
local ignore_extract="${11}"
local download_dir="${DEVON_DOWNLOAD_DIR}"
if [ -z "${target_path}" ] || [ -z "${url}" ] || [ -z "${software}" ]
then
Expand Down Expand Up @@ -1233,10 +1235,16 @@ function doInstall() {
fi
if [ ! -d "${install_path}" ] || [ "${install_path}" == "${target_path}" ]
then
doDownload "${url}" "${download_dir}" "${software}" "${version}" "${edition}" "${code}" "${os}" "${arch}" "${ext}"
doDebug "Received download file ${DOWNLOAD_FILENAME}"
doExtract "${download_dir}/${DOWNLOAD_FILENAME}" "${dir}"
doReplaceExtracted "${DEVON_IDE_HOME}/updates/extracted/${dir}" "${install_path}"
if [ -n "${ignore_extract}" ]
then
doDownload "${url}" "${target_path}" "${software}" "${version}" "${edition}" "${code}" "${os}" "${arch}" "${ext}"
doDebug "Received download file ${DOWNLOAD_FILENAME}"
else
doDownload "${url}" "${download_dir}" "${software}" "${version}" "${edition}" "${code}" "${os}" "${arch}" "${ext}"
doDebug "Received download file ${DOWNLOAD_FILENAME}"
doExtract "${download_dir}/${DOWNLOAD_FILENAME}" "${dir}"
doReplaceExtracted "${DEVON_IDE_HOME}/updates/extracted/${dir}" "${install_path}"
fi
if [ "${install_path}" != "${DEVON_IDE_HOME}" ]
then
echo "${version}" > "${version_file}"
Expand Down