Skip to content

Commit 0fffd26

Browse files
committed
[feature] Make Monex compatible with eXist-db and Elemental versions 6.x.x and 7.x.x
See evolvedbinary/elemental#6
1 parent 1c83e33 commit 0fffd26

35 files changed

Lines changed: 2113 additions & 948 deletions

.github/workflows/ci.yml

Lines changed: 50 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,60 @@ name: CI
22
on: [push, pull_request]
33
jobs:
44
build:
5-
name: Build and Test (${{ matrix.os }} / OpenJDK ${{ matrix.jdk }})
6-
strategy:
7-
fail-fast: true
8-
matrix:
9-
jdk: ['8', '11']
10-
os: [ubuntu-latest]
11-
runs-on: ${{ matrix.os }}
5+
name: Build
6+
runs-on: ubuntu-latest
127
steps:
138
- uses: actions/checkout@v4
14-
- name: Set up JDK ${{ matrix.jdk }}
9+
- name: Set up JDK
1510
uses: actions/setup-java@v4
1611
with:
1712
distribution: temurin
18-
java-version: ${{ matrix.jdk }}
19-
- name: Cache Maven packages
20-
uses: actions/cache@v4
21-
with:
22-
path: ~/.m2
23-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
24-
restore-keys: ${{ runner.os }}-m2
13+
java-version: 21
14+
cache: maven
2515
- name: Maven Build
2616
run: mvn clean package -DskipTests
27-
- name: Test
28-
env:
29-
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
30-
run: mvn verify -P cypress-without-record
17+
- uses: actions/upload-artifact@v4
18+
with:
19+
name: target
20+
path: target/
21+
retention-days: 1
22+
23+
test6:
24+
name: Integration Test (DB API 6.x.x)
25+
needs: build
26+
runs-on: ubuntu-latest
27+
env:
28+
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
29+
steps:
30+
- uses: actions/checkout@v4
31+
- name: Set up JDK
32+
uses: actions/setup-java@v4
33+
with:
34+
distribution: temurin
35+
java-version: 21
36+
cache: maven
37+
- uses: actions/download-artifact@v4
38+
with:
39+
name: target
40+
- name: Maven Test
41+
run: mvn verify -Dgpg.skip -P docker-integration-test-db-api-6,cypress-with-recording-db-api-6
42+
43+
test7:
44+
name: Integration Test (DB API 7.x.x)
45+
needs: build
46+
runs-on: ubuntu-latest
47+
env:
48+
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
49+
steps:
50+
- uses: actions/checkout@v4
51+
- name: Set up JDK
52+
uses: actions/setup-java@v4
53+
with:
54+
distribution: temurin
55+
java-version: 21
56+
cache: maven
57+
- uses: actions/download-artifact@v4
58+
with:
59+
name: target
60+
- name: Maven Test
61+
run: mvn verify -Dgpg.skip -P docker-integration-test-db-api-7,cypress-with-recording-db-api-7

.gitignore

Lines changed: 6 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
##############################
2-
## Java
3-
##############################
4-
.mtj.tmp/
5-
*.class
6-
*.jar
7-
*.war
8-
*.ear
9-
*.nar
10-
hs_err_pid*
11-
12-
##############################
13-
## Maven
2+
## Java / Maven
143
##############################
154
target/
165
pom.xml.tag
@@ -19,76 +8,25 @@ pom.xml.versionsBackup
198
pom.xml.next
209
pom.xml.bak
2110
release.properties
22-
dependency-reduced-pom.xml
23-
buildNumber.properties
24-
.mvn/timing.properties
25-
!.mvn/wrapper/maven-wrapper.jar
26-
node/
2711

2812
##############################
29-
## Gradle
13+
## Node.js
3014
##############################
31-
bin/
32-
build/
33-
.gradle
34-
.gradletasknamecache
35-
gradle-app.setting
36-
!gradle-wrapper.jar
15+
node/
16+
node_modules/
3717

3818
##############################
39-
## IntelliJ
19+
## IntelliJ IDEA
4020
##############################
41-
out/
4221
.idea/
43-
.idea_modules/
44-
*.iml
45-
*.ipr
46-
*.iws
47-
48-
##############################
49-
## Eclipse
50-
##############################
51-
.settings/
52-
bin/
53-
tmp/
54-
.metadata
55-
.classpath
56-
.project
57-
*.tmp
58-
*.bak
59-
*.swp
60-
*~.nib
61-
local.properties
62-
.loadpath
63-
.factorypath
64-
65-
##############################
66-
## NetBeans
67-
##############################
68-
nbproject/private/
69-
build/
70-
nbbuild/
71-
dist/
72-
nbdist/
73-
nbactions.xml
74-
nb-configuration.xml
7522

7623
##############################
7724
## Visual Studio Code
7825
##############################
7926
.vscode/
8027
.code-workspace
8128

82-
8329
##############################
84-
## OS X
30+
## macOS
8531
##############################
8632
.DS_Store
87-
88-
##############################
89-
## Node / JS
90-
##############################
91-
node_modules/
92-
93-
src/test/cypress/videos/*
94-
src/test/cypress/screenshots/*

README.md

Lines changed: 46 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
# Monex (Monitoring for eXist)
1+
# Monex (Monitoring for eXist-db and Elemental)
22

33
[![Build Status](https://github.com/eXist-db/monex/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/eXist-db/exist/monex/workflows/ci.yml)
4+
[![Java 21](https://img.shields.io/badge/java-21-blue.svg)](https://adoptopenjdk.net/)
5+
[![License](https://img.shields.io/badge/license-LGPL%202.1-blue.svg)](https://www.gnu.org/licenses/lgpl-2.1.html)
46

57
![Image](src/main/xar-resources/resources/img/screenshot.png?raw=true)
68

7-
An application for monitoring, profiling and inspecting a running eXist-db instance.
9+
An application for monitoring, profiling and inspecting a running eXist-db or Elemental instance.
810

911
## Features
1012

@@ -13,50 +15,33 @@ The app includes:
1315
- **Monitoring dashboard**: shows memory usage, running queries, locked threads, cache usage and more
1416
- **Query profiling** page: essential for tuning queries and indexes
1517
- **Index browser**: inspect existing indexes
16-
- **Remote console**: send log messages from any query in eXist to the remote console.
18+
- **Remote console**: send log messages from any query to the remote console.
1719
Uses web sockets for real-time updates.
1820
- **Data visualizer**: get a quick overview of the frequency of elements in a collection.
19-
- **Remote Monitoring**: monitor multiple remote eXistdb instances. Provides timelines for long term monitoring.
21+
- **Remote Monitoring**: monitor multiple remote instances. Provides timelines for long term monitoring.
2022

2123
## Configure Monex
2224

2325
### Enable Remote Monitoring
2426

2527
#### Preconditions
2628

27-
Monex remote monitoring requires the eXistdb scheduler module to be enabled. Make sure it is enabled in `$eXistdb_home/extensions/build.properties`
28-
29-
```txt
30-
# Scheduler module
31-
include.module.scheduler = true
32-
```
33-
34-
and in `$eXistdb_home/conf.xml` make sure the Scheduler module is not commented out:
29+
Monex remote monitoring requires the Scheduler Module to be enabled. Make sure the Scheduler module is not commented out in `etc/conf.xml`:
3530

3631
```xml
3732
<module uri="http://exist-db.org/xquery/scheduler"
3833
class="org.exist.xquery.modules.scheduler.SchedulerModule" />
3934
```
4035

41-
##### Rebuilding eXistdb
42-
43-
This needs only to be done if `include.module.scheduler` in `extensions/build.properties` was set to `false`. Then eXistdb has to be rebuild to enable the scheduler module. Shutdown the database and in the root of the eXistdb project simply call
44-
45-
```shell
46-
./build.sh
47-
```
48-
49-
After starting the database again, the remote monitoring tab should show no more error warnings.
36+
#### Adding an instance to monitor
5037

51-
#### Adding an eXistdb instance to monitor
52-
53-
For each eXistdb instance to monitor its url and its unique token is needed. The token can be found in the data directory on the filesystem . The file is called `jmxservlet.token`. The path to the data directory can be found in `$existdb_home/conf.xml`
38+
For each instance to monitor its URL and its unique token is needed. The token can be found in the data directory on the filesystem . The file is called `jmxservlet.token`. The path to the data directory can be found in `etc/conf.xml`
5439

5540
```xml
5641
<db-connection files="path-to-your-data-dir" ... />
5742
```
5843

59-
Each eXistdb installation to monitor is added as an instance entry at `/db/apps/monex/instances.xml`.
44+
Each installation to monitor is added as an instance entry at `/db/apps/monex/instances.xml`.
6045

6146
#### Sample Monex Instances
6247

@@ -81,31 +66,45 @@ In the Monex Remote Monitoring tab click "Run" to start all remote monitoring jo
8166

8267
If you wish to build Monex from source code you should follow these steps:
8368

84-
1. Ensure you have Git, Apache Maven 3.3+, and Java JDK 8 installed and available:
69+
1. Ensure you have Git, GnuPG, Apache Maven 3.3+, and Java JDK 21 installed and available. If you wish to run the test suite, you will also need to have Docker installed.
8570

8671
```bash
8772
$ git --version
88-
git version 2.20.0
73+
git version 2.49.0
8974

9075
$ mvn --version
9176

92-
Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-18T02:33:14+08:00)
93-
Maven home: /usr/local/maven
94-
Java version: 1.8.0_192, vendor: Azul Systems, Inc., runtime: /Library/Java/JavaVirtualMachines/zulu8.33.0.1-jdk8.0.192-macosx_x64/jre
77+
Apache Maven 3.9.10 (5f519b97e944483d878815739f519b2eade0a91d)
78+
Maven home: /usr/local/Cellar/maven/3.9.10/libexec
79+
Java version: 21.0.7, vendor: Eclipse Adoptium, runtime: /Library/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home
9580
Default locale: en_GB, platform encoding: UTF-8
96-
OS name: "mac os x", version: "10.14.1", arch: "x86_64", family: "mac"
81+
OS name: "mac os x", version: "15.4.1", arch: "x86_64", family: "mac"
9782
```
9883

99-
1. Clone and build an EXPath package by running:
84+
2. Clone and build an EXPath package of Monex by running:
10085

10186
```bash
102-
git clone https://github.com/eXist-db/monex.git
87+
git clone https://github.com/exist-db/monex.git
10388
cd monex
10489
mvn package
10590
```
10691

10792
The resulting XAR will be in the `target/` folder.
10893

94+
95+
3. Running the Test Suite:
96+
97+
1. Against eXist-db 6.x.x:
98+
99+
```bash
100+
mvn verify -P docker-integration-test-db-api-6,cypress-with-recording-db-api-6
101+
```
102+
103+
2. Against Elemental 7.x.x:
104+
```bash
105+
mvn verify -P docker-integration-test-db-api-7,cypress-with-recording-db-api-7
106+
```
107+
109108
## Release Procedure
110109

111110
This project is configured to use the [Maven Release Plugin](https://maven.apache.org/maven-release/maven-release-plugin/) to make creating and subsequently publishing a release easy.
@@ -126,17 +125,24 @@ Only users with push access to the GitHub repo can act as release manager.
126125
Before creating the release, check if:
127126

128127
- [ ] the changelog is up-to-date for the planned release?
129-
- [ ] the target versions for eXistdb are correctly declared in `pom.xml`?
128+
- [ ] the target versions for the Database API and Implementation are correctly declared in `monex-parent/pom.xml`?
130129

131130
```xml
132-
<exist.java-api.version>5.4.0</exist.java-api.version>
133-
<exist.processor.version>7.0.0-SNAPSHOT</exist.processor.version>
131+
<!-- Version of eXist-db and Elemental 6.x.x that Monex is compatible with -->
132+
<db.api.6.version>6.0.0</db.api.6.version>
133+
<db.api.6.impl.version>6.1.0</db.api.6.impl.version>
134+
<db.api.6.java.version>1.8</db.api.6.java.version>
135+
136+
<!-- Version of eXist-db and Elemental 7.x.x that Monex is compatible with -->
137+
<db.api.7.version>7.0.0</db.api.7.version>
138+
<db.api.7.impl.version>7.0.0</db.api.7.impl.version>
139+
<db.api.7.java.version>21</db.api.7.java.version>
134140
```
135141

136142

137143
#### Changelog
138144

139-
To edit release notes for the planned release within `xar-assembly.xml` located in the root of this repo, e.g.:
145+
To edit the release notes for the planned release within `xar-assembly.xml` located in the root of this repo, e.g.:
140146

141147
```xml
142148
<changelog>
@@ -160,9 +166,9 @@ mvn release:prepare && mvn release:perform
160166
You will be prompted for the answers to a few questions along the way. The default response will be provided for you, and you can simply press "Enter" (or "Return") to accept it. Alternatively you may enter your own value and press "Enter" (or "Return").
161167

162168
```bash
163-
What is the release version for "monex"? (org.exist-db.apps:monex) 2.3.1: : 2.4.0
164-
What is SCM release tag or label for "monex"? (org.exist-db.apps:monex) 2.4.0: :
165-
What is the new development version for "monex"? (org.exist-db.apps:monex) 2.4.1-SNAPSHOT: :
169+
What is the release version for "monex"? (org.exist-db.apps:monex) 4.3.0:
170+
What is SCM release tag or label for "monex"? (org.exist-db.apps:monex) 4.3.0:
171+
What is the new development version for "monex"? (org.exist-db.apps:monex) 4.3.1-SNAPSHOT:
166172
```
167173

168174
- For the `release version`, please sensibly consider using the next appropriate [SemVer 2.0.0](https://semver.org/) version number.

cypress.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
2-
"baseUrl": "http://localhost:8080/exist",
2+
"baseUrl": "http://localhost:10086/exist",
33
"fileServerFolder": "src/main/xar-resources",
44
"ignoreTestFiles": "src/test/cypress/integration/examples/*.js",
55
"fixturesFolder": "src/test/cypress/fixtures",
66
"integrationFolder": "src/test/cypress/integration",
77
"pluginsFile": "src/test/cypress/plugins/index.js",
8-
"screenshotsFolder": "src/test/cypress/screenshots",
98
"supportFile": "src/test/cypress/support/index.js",
10-
"videosFolder": "src/test/cypress/videos",
9+
"downloadsFolder": "target/cypress/downloads",
10+
"videosFolder": "target/cypress/videos",
11+
"screenshotsFolder": "target/cypress/screenshots",
1112
"projectId": "snavwf"
1213
}

0 commit comments

Comments
 (0)