Skip to content

Commit

Permalink
Rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
tjquinno committed Aug 31, 2023
1 parent c36953f commit 9eb9e92
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ private record GaugeInfo<T>(String name,
ToDoubleFunction<T> fn,
Tag... tags) {

Gauge.Builder<T> builder(T stateObject) {
Gauge.Builder<T> builder = Gauge.builder(name, stateObject, fn)
Gauge.Builder builder(T stateObject) {
Gauge.Builder<Double> builder = Gauge.builder(name, stateObject, fn)
.description(description);
if (unit != null) {
builder.baseUnit(unit);
Expand Down
2 changes: 0 additions & 2 deletions integrations/neo4j/metrics/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
requires io.helidon.integrations.neo4j;
requires io.helidon.metrics.api;

requires org.neo4j.driver;

requires transitive io.helidon.common;
requires transitive org.neo4j.driver;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private Stream<MetricDataDetails> forCounter(Meter.Id metricId, Counter counter)
}

private Stream<MetricDataDetails> forGauge(Meter.Id metricId, Gauge gauge) {
return Stream.of(metricDataDetails(gauge, metricId, null, gauge.value()));
return Stream.of(metricDataDetails(gauge, metricId, null, gauge.value().doubleValue()));
}

private Stream<MetricDataDetails> forTimer(Meter.Id metricId, Timer timer) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ interface Builder<B extends Builder<B, M>, M extends Meter> {
*
* @return properly-typed builder itself
*/
@SuppressWarnings("unchecked")
default B identity() {
return (B) this;
}
Expand Down
13 changes: 11 additions & 2 deletions metrics/metrics/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,15 @@
</properties>

<dependencies>
<dependency>
<dependency>
<groupId>io.helidon.common.features</groupId>
<artifactId>helidon-common-features-api</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.metrics</groupId>
<artifactId>helidon-metrics-api</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.metrics.providers</groupId>
<artifactId>helidon-metrics-providers-micrometer</artifactId>
<scope>runtime</scope>
Expand All @@ -50,7 +58,8 @@
<artifactId>helidon-metrics-system-meters</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>

</dependencies>

<build>
<plugins>
Expand Down
1 change: 0 additions & 1 deletion metrics/metrics/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
in = HelidonFlavor.SE,
path = {"Metrics"}
)
@SuppressWarnings({ "requires-automatic", "requires-transitive-automatic" })
module io.helidon.metrics {
requires static io.helidon.common.features.api;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ private static MetricsFeature createMetricsService(Config helidonConfig) {

MetricsFeature.Builder builder = MetricsFeature.builder()
.meterRegistry(metricsFactory.globalRegistry())
.metricsConfig(metricsFactory.metricsConfig())
.metricsConfig(MetricsConfig.builder(metricsFactory.metricsConfig()))
.webContext("/metrics")
.config(helidonConfig);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -624,8 +624,8 @@ private <N extends Number> HelidonGauge<N> createGauge(io.helidon.metrics.api.Ga
private <T> HelidonGauge<Long> createFunctionalCounter(io.helidon.metrics.api.FunctionalCounter.Builder<T> fcBuilder) {
io.helidon.metrics.api.Gauge delegate = meterRegistry
.getOrCreate(io.helidon.metrics.api.Gauge.builder(fcBuilder.name(),
() -> (long) fcBuilder.fn()
.applyAsDouble(fcBuilder.stateObject())));
() -> fcBuilder.fn()
.apply(fcBuilder.stateObject())));
return (HelidonGauge<Long>) metricsByDelegate.get(delegate);
}

Expand Down
5 changes: 2 additions & 3 deletions microprofile/metrics/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
)
@SuppressWarnings({ "requires-automatic", "requires-transitive-automatic" })
module io.helidon.microprofile.metrics {
requires static io.helidon.common.features.api;

requires io.helidon.config.mp;
requires io.helidon.metrics.api;
Expand All @@ -54,8 +53,8 @@
opens io.helidon.microprofile.metrics.spi to io.helidon.microprofile.cdi, weld.core.impl;

provides jakarta.enterprise.inject.spi.Extension with io.helidon.microprofile.metrics.MetricsCdiExtension;
provides io.helidon.metrics.spi.MetricsProgrammaticSettings
with io.helidon.microprofile.metrics.MpMetricsProgrammaticSettings;
provides io.helidon.metrics.spi.MetricsProgrammaticConfig
with io.helidon.microprofile.metrics.MpMetricsProgrammaticConfig;
provides io.helidon.metrics.spi.MeterRegistryLifeCycleListener
with io.helidon.microprofile.metrics.RegistryFactoryManager;
provides io.helidon.metrics.spi.InitialMetersConsumer
Expand Down

0 comments on commit 9eb9e92

Please sign in to comment.