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

Progress with cleanup. #2

Merged
merged 7 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @rhusar
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: maven
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
12 changes: 3 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest ]
java: [ 11 ]
java: [ 17 ]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -21,12 +21,6 @@ jobs:
with:
distribution: temurin
java-version: ${{ matrix.java }}
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
cache: maven
- name: Build with Maven
run: mvn --batch-mode --no-transfer-progress verify
run: ./mvnw --batch-mode --no-transfer-progress verify
8 changes: 1 addition & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,10 @@ pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
.mvn/wrapper/maven-wrapper.jar

# Eclipse m2e generated files
# Eclipse Core
# Eclipse IDE
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath

# IntelliJ IDEA
.idea/

19 changes: 19 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
31 changes: 31 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
= mod_cluster Examples

Set of examples demonstrating various features of the mod_cluster project.

== Load Balancing Demo

The original load-balancing demo originally in the main mod_cluster repository.

== Building

When building from source, first ensure JDK 17 or newer (run `java -version`) is installed.
The following command builds all examples:

[source,shell]
----
./mvnw clean install
----

== Reporting Issues

Project mod_cluster uses Red Hat Jira issue tracker under MODCLUSTER project:

https://issues.redhat.com/browse/MODCLUSTER

Issues can also be filed using GitHub Issues of this repository:

https://github.com/modcluster/mod_cluster-examples/issues

== License

* https://www.apache.org/licenses/LICENSE-2.0[Apache License 2.0]
2 changes: 0 additions & 2 deletions README.md

This file was deleted.

4 changes: 2 additions & 2 deletions load-balancing-demo/client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
<parent>
<groupId>org.jboss.mod_cluster</groupId>
<artifactId>mod_cluster-demo</artifactId>
<version>2.0.4.Final-SNAPSHOT</version>
<version>2.1.0.Final-SNAPSHOT</version>
</parent>
<artifactId>mod_cluster-demo-client</artifactId>
<name>mod_cluster: Demo - Client</name>
<name>mod_cluster Examples: Demo - Client</name>
<packaging>jar</packaging>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void start() {
}

public void updateStats() {
Integer xValue = new Integer(++seriesCount);
Integer xValue = ++seriesCount;

long now = System.currentTimeMillis();
long elapsed = (now - lastUpdateTime) / 1000L;
Expand All @@ -75,10 +75,10 @@ public void updateStats() {

for (Map.Entry<String, AtomicInteger> entry : requestCounts.entrySet()) {
String key = entry.getKey();
Integer current = new Integer(entry.getValue().get());
Integer current = entry.getValue().get();
Integer last = lastRequestCounts.put(key, current);
if (last == null) {
last = new Integer(0);
last = 0;
}

int perSec = (int) ((current.intValue() - last.intValue()) / elapsed);
Expand All @@ -88,7 +88,7 @@ public void updateStats() {
series = createRequestSeries(key);
}

series.add(xValue, new Integer(perSec));
series.add(xValue, Integer.valueOf(perSec));
}

for (Map.Entry<String, AtomicInteger> entry : sessionCounts.entrySet()) {
Expand All @@ -98,7 +98,7 @@ public void updateStats() {
series = createSessionSeries(key);
}

series.add(xValue, new Integer(entry.getValue().get()));
series.add(xValue, Integer.valueOf(entry.getValue().get()));
}
}

Expand Down
88 changes: 2 additions & 86 deletions load-balancing-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,17 @@
<parent>
<groupId>org.jboss.mod_cluster</groupId>
<artifactId>mod_cluster-examples-parent</artifactId>
<version>2.0.4.Final-SNAPSHOT</version>
<version>2.1.0.Final-SNAPSHOT</version>
</parent>
<artifactId>mod_cluster-demo</artifactId>
<name>mod_cluster: Demo (parent)</name>
<name>mod_cluster Examples: Demo (parent)</name>
<packaging>pom</packaging>
<modules>
<module>client</module>
<module>server</module>
</modules>

<properties>
<!-- Require and build for JDK 11 -->
<jdk.min.version>11</jdk.min.version>
<jdk.release.version>11</jdk.release.version>

<!-- Common dependency -->
<version.jboss-logging>3.5.3.Final</version.jboss-logging>
<version.jboss-logging-processor>2.2.1.Final</version.jboss-logging-processor>
Expand All @@ -34,85 +30,10 @@
<version.junit>4.13.2</version.junit>
<version.mockito>5.8.0</version.mockito>
<version.javax.servlet-3.0>1.0.2.Final</version.javax.servlet-3.0>

<!-- Plugin versions -->
<version.org.wildfly.checkstyle-config>1.0.8.Final</version.org.wildfly.checkstyle-config>
<version.org.jacoco.jacoco-maven-plugin>0.8.11</version.org.jacoco.jacoco-maven-plugin>
</properties>

<profiles>
<!-- Code coverage report using JaCoCo -->
<profile>
<id>coverage</id>
<activation>
<property>
<name>coverage</name>
</property>
</activation>
<modules>
<module>code-coverage</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>jacoco-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.mod_cluster</groupId>
<artifactId>mod_cluster-container-spi</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.mod_cluster</groupId>
<artifactId>mod_cluster-container-tomcat-8.5</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.mod_cluster</groupId>
<artifactId>mod_cluster-container-tomcat-9.0</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.mod_cluster</groupId>
<artifactId>mod_cluster-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.mod_cluster</groupId>
<artifactId>mod_cluster-load-spi</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.mod_cluster</groupId>
<artifactId>mod_cluster-demo</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.mod_cluster</groupId>
<artifactId>mod_cluster-demo-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.mod_cluster</groupId>
<artifactId>mod_cluster-demo-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.servlet</groupId>
<artifactId>jboss-servlet-api_3.0_spec</artifactId>
Expand Down Expand Up @@ -264,11 +185,6 @@
<useFile />
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${version.org.jacoco.jacoco-maven-plugin}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down
4 changes: 2 additions & 2 deletions load-balancing-demo/server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
<parent>
<groupId>org.jboss.mod_cluster</groupId>
<artifactId>mod_cluster-demo</artifactId>
<version>2.0.4.Final-SNAPSHOT</version>
<version>2.1.0.Final-SNAPSHOT</version>
</parent>
<artifactId>mod_cluster-demo-server</artifactId>
<name>mod_cluster: Demo - Server</name>
<name>mod_cluster Examples: Demo - Server</name>
<packaging>war</packaging>
<dependencies>
<dependency>
Expand Down
Loading
Loading