Skip to content

Commit

Permalink
chore: pull engine version from yggdrasil
Browse files Browse the repository at this point in the history
  • Loading branch information
sighphyre committed Jan 15, 2025
1 parent 937b29c commit cbaa590
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<dependency>
<groupId>io.getunleash</groupId>
<artifactId>yggdrasil-engine</artifactId>
<version>0.1.0-alpha.12</version>
<version>0.1.0-alpha.13</version>
<classifier>${os.detected.classifier}</classifier>
</dependency>
<dependency>
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/io/getunleash/metric/ClientMetrics.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.getunleash.metric;

import io.getunleash.engine.MetricsBucket;
import io.getunleash.engine.UnleashEngine;
import io.getunleash.event.UnleashEvent;
import io.getunleash.event.UnleashSubscriber;
import io.getunleash.lang.Nullable;
Expand All @@ -25,7 +26,7 @@ public class ClientMetrics implements UnleashEvent {
this.specVersion = config.getClientSpecificationVersion();
this.platformName = System.getProperty("java.vm.name");
this.platformVersion = System.getProperty("java.version");
this.yggdrasilVersion = null;
this.yggdrasilVersion = UnleashEngine.getCoreVersion();
}

public String getAppName() {
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/io/getunleash/metric/ClientRegistration.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.getunleash.metric;

import io.getunleash.engine.UnleashEngine;
import io.getunleash.event.UnleashEvent;
import io.getunleash.event.UnleashSubscriber;
import io.getunleash.lang.Nullable;
Expand Down Expand Up @@ -31,7 +32,7 @@ public class ClientRegistration implements UnleashEvent {
this.specVersion = config.getClientSpecificationVersion();
this.platformName = System.getProperty("java.vm.name");
this.platformVersion = System.getProperty("java.version");
this.yggdrasilVersion = null;
this.yggdrasilVersion = UnleashEngine.getCoreVersion();
}

public String getAppName() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ public void should_add_new_metrics_data_to_bucket() {
verify(sender, times(1)).sendMetrics(metricsSent.capture());
ClientMetrics metrics = metricsSent.getValue();
assertThat(metrics.getSpecVersion()).isNotEmpty();
assertThat(metrics.getYggdrasilVersion()).isNull();
assertThat(metrics.getYggdrasilVersion()).isNotEmpty();
assertThat(metrics.getPlatformName()).isNotEmpty();
assertThat(metrics.getPlatformVersion()).isNotEmpty();
}
Expand All @@ -467,6 +467,6 @@ public void client_registration_also_includes_new_metrics_metadata() {
assertThat(reg.getPlatformName()).isNotEmpty();
assertThat(reg.getPlatformVersion()).isNotEmpty();
assertThat(reg.getSpecVersion()).isEqualTo(config.getClientSpecificationVersion());
assertThat(reg.getYggdrasilVersion()).isNull();
assertThat(reg.getYggdrasilVersion()).isNotEmpty();
}
}

0 comments on commit cbaa590

Please sign in to comment.