Skip to content

Commit

Permalink
code formating and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-confino committed Apr 17, 2024
1 parent 8955a0a commit 54f023f
Show file tree
Hide file tree
Showing 6 changed files with 176 additions and 445 deletions.
29 changes: 29 additions & 0 deletions tck/formatter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
Copyright (c) 2009-2024 Contributors to the Eclipse Foundation
See the NOTICE file(s) distributed with this work for additional
information regarding copyright ownership.
Licensed 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.
-->
<profiles version="1">
<profile kind="CodeFormatterProfile" name="MicroProfile" version="1">
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120"/>
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_field_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="18"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="16"/>
</profile>
</profiles>
251 changes: 131 additions & 120 deletions tck/pom.xml
Original file line number Diff line number Diff line change
@@ -1,126 +1,137 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Licensed 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. -->
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. -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<!-- This is just for now and will not work if the API has a separate release
cycle than the rest. -->
<groupId>org.eclipse.microprofile.fault-tolerance</groupId>
<artifactId>microprofile-fault-tolerance-parent</artifactId>
<version>4.1-SNAPSHOT</version>
</parent>

<groupId>org.eclipse.microprofile.fault-tolerance</groupId>
<artifactId>microprofile-fault-tolerance-tck</artifactId>
<version>4.1-SNAPSHOT</version>

<description>Fault Tolerance for MicroProfile :: TCK</description>
<properties>
<checkstyle.methodNameFormat>^_?[a-z][a-zA-Z0-9_]*$</checkstyle.methodNameFormat>
<microprofile-config-api.version>3.0</microprofile-config-api.version>
<microprofile-metrics-api.version>4.0</microprofile-metrics-api.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile-tck-bom</artifactId>
<version>${version.microprofile.tck.bom}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>


<dependencies>
<dependency>
<groupId>org.eclipse.microprofile.fault-tolerance</groupId>
<artifactId>microprofile-fault-tolerance-api</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-api</artifactId>
<version>1.36.0</version>
</dependency>

<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.eclipse.microprofile.metrics</groupId>
<artifactId>microprofile-metrics-api</artifactId>
<version>${microprofile-metrics-api.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.eclipse.microprofile.config</groupId>
<artifactId>microprofile-config-api</artifactId>
<version>${microprofile-config-api.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk-metrics</artifactId>
<version>1.36.0</version>
</dependency>

<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk-extension-autoconfigure</artifactId>
<version>1.36.0</version>
</dependency>

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.testng</groupId>
<artifactId>arquillian-testng-container</artifactId>
</dependency>

<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-api</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.descriptors</groupId>
<artifactId>shrinkwrap-descriptors-impl-javaee</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>4.0.3</version>
<scope>compile</scope>
</dependency>
</dependencies>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<!-- This is just for now and will not work if the API has a separate release
cycle than the rest. -->
<groupId>org.eclipse.microprofile.fault-tolerance</groupId>
<artifactId>microprofile-fault-tolerance-parent</artifactId>
<version>4.1-SNAPSHOT</version>
</parent>

<groupId>org.eclipse.microprofile.fault-tolerance</groupId>
<artifactId>microprofile-fault-tolerance-tck</artifactId>
<version>4.1-SNAPSHOT</version>

<description>Fault Tolerance for MicroProfile :: TCK</description>
<properties>
<checkstyle.methodNameFormat>^_?[a-z][a-zA-Z0-9_]*$</checkstyle.methodNameFormat>
<microprofile-config-api.version>3.0</microprofile-config-api.version>
<microprofile-metrics-api.version>4.0</microprofile-metrics-api.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile-tck-bom</artifactId>
<version>${version.microprofile.tck.bom}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<plugins>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<configuration>
<configFile>${project.basedir}/formatter.xml</configFile>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.eclipse.microprofile.fault-tolerance</groupId>
<artifactId>microprofile-fault-tolerance-api</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-api</artifactId>
<version>1.36.0</version>
</dependency>

<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.eclipse.microprofile.metrics</groupId>
<artifactId>microprofile-metrics-api</artifactId>
<version>${microprofile-metrics-api.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.eclipse.microprofile.config</groupId>
<artifactId>microprofile-config-api</artifactId>
<version>${microprofile-config-api.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk-metrics</artifactId>
<version>1.36.0</version>
</dependency>

<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk-extension-autoconfigure</artifactId>
<version>1.36.0</version>
</dependency>

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.testng</groupId>
<artifactId>arquillian-testng-container</artifactId>
</dependency>

<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-api</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.descriptors</groupId>
<artifactId>shrinkwrap-descriptors-impl-javaee</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>4.0.3</version>
<scope>compile</scope>
</dependency>
</dependencies>


</project>
Original file line number Diff line number Diff line change
Expand Up @@ -49,33 +49,20 @@
* {@link BulkheadResult#ACCEPTED} and {@link BulkheadResult#REJECTED}.
*/
public enum MetricDefinition {
INVOCATIONS("ft.invocations.total", Set.of(LongCounter.class), InvocationResult.class,
InvocationFallback.class), RETRY_CALLS("ft.retry.calls.total", Set.of(LongCounter.class),
RetryRetried.class, RetryResult.class), RETRY_RETRIES("ft.retry.retries.total",
Set.of(LongCounter.class)), TIMEOUT_CALLS("ft.timeout.calls.total",
Set.of(LongCounter.class), TimeoutTimedOut.class), TIMEOUT_EXECUTION_DURATION(
"ft.timeout.executionDuration", Set.of(LongHistogram.class),
"nanoseconds"), CIRCUITBREAKER_CALLS("ft.circuitbreaker.calls.total",
Set.of(LongCounter.class),
CircuitBreakerResult.class), CIRCUITBREAKER_STATE(
"ft.circuitbreaker.state.total",
Set.of(ObservableLongGauge.class), "nanoseconds",
CircuitBreakerState.class), CIRCUITBREAKER_OPENED(
"ft.circuitbreaker.opened.total",
Set.of(LongCounter.class)), BULKHEAD_CALLS(
"ft.bulkhead.calls.total",
Set.of(LongCounter.class),
BulkheadResult.class), BULKHEAD_EXECUTIONS_RUNNING(
"ft.bulkhead.executionsRunning",
Set.of(ObservableLongGauge.class)), BULKHEAD_EXECUTIONS_WAITING(
"ft.bulkhead.executionsWaiting",
Set.of(ObservableLongGauge.class)), BULKHEAD_RUNNING_DURATION(
"ft.bulkhead.runningDuration",
Set.of(LongHistogram.class),
"nanoseconds"), BULKHEAD_WAITING_DURATION(
"ft.bulkhead.waitingDuration",
Set.of(LongHistogram.class),
"nanoseconds");
INVOCATIONS("ft.invocations.total", Set.of(LongCounter.class), InvocationResult.class, InvocationFallback.class),
RETRY_CALLS("ft.retry.calls.total", Set.of(LongCounter.class), RetryRetried.class, RetryResult.class),
RETRY_RETRIES("ft.retry.retries.total", Set.of(LongCounter.class)),
TIMEOUT_CALLS("ft.timeout.calls.total", Set.of(LongCounter.class), TimeoutTimedOut.class),
TIMEOUT_EXECUTION_DURATION("ft.timeout.executionDuration", Set.of(LongHistogram.class), "nanoseconds"),
CIRCUITBREAKER_CALLS("ft.circuitbreaker.calls.total", Set.of(LongCounter.class), CircuitBreakerResult.class),
CIRCUITBREAKER_STATE("ft.circuitbreaker.state.total", Set.of(ObservableLongGauge.class), "nanoseconds",
CircuitBreakerState.class),
CIRCUITBREAKER_OPENED("ft.circuitbreaker.opened.total", Set.of(LongCounter.class)),
BULKHEAD_CALLS("ft.bulkhead.calls.total", Set.of(LongCounter.class), BulkheadResult.class),
BULKHEAD_EXECUTIONS_RUNNING("ft.bulkhead.executionsRunning", Set.of(ObservableLongGauge.class)),
BULKHEAD_EXECUTIONS_WAITING("ft.bulkhead.executionsWaiting", Set.of(ObservableLongGauge.class)),
BULKHEAD_RUNNING_DURATION("ft.bulkhead.runningDuration", Set.of(LongHistogram.class), "nanoseconds"),
BULKHEAD_WAITING_DURATION("ft.bulkhead.waitingDuration", Set.of(LongHistogram.class), "nanoseconds");

private String name;
private String unit;
Expand Down Expand Up @@ -216,7 +203,8 @@ public Attributes getAttribute() {

public enum RetryResult implements AttributeValue {
VALUE_RETURNED("valueReturned"), EXCEPTION_NOT_RETRYABLE("exceptionNotRetryable"), MAX_RETRIES_REACHED(
"maxRetriesReached"), MAX_DURATION_REACHED("maxDurationReached");
"maxRetriesReached"),
MAX_DURATION_REACHED("maxDurationReached");

private Attributes attribute;

Expand Down
Loading

0 comments on commit 54f023f

Please sign in to comment.