@@ -74,7 +74,7 @@ public class UnleashConfig {
7474 @ Nullable private final ToggleBootstrapProvider toggleBootstrapProvider ;
7575 @ Nullable private final Proxy proxy ;
7676 @ Nullable private final Consumer <UnleashException > startupExceptionHandler ;
77- @ Nullable private final ImpactMetricsDataSource impactMetricsRegistry ;
77+ private final ImpactMetricsDataSource impactMetricsRegistry ;
7878
7979 private UnleashConfig (
8080 @ Nullable URI unleashAPI ,
@@ -109,7 +109,7 @@ private UnleashConfig(
109109 @ Nullable Proxy proxy ,
110110 @ Nullable Authenticator proxyAuthenticator ,
111111 @ Nullable Consumer <UnleashException > startupExceptionHandler ,
112- @ Nullable ImpactMetricsDataSource impactMetricsRegistry ) {
112+ ImpactMetricsDataSource impactMetricsRegistry ) {
113113
114114 if (appName == null ) {
115115 throw new IllegalStateException ("You are required to specify the unleash appName" );
@@ -356,7 +356,6 @@ public Proxy getProxy() {
356356 return proxy ;
357357 }
358358
359- @ Nullable
360359 public ImpactMetricsDataSource getImpactMetricsRegistry () {
361360 return impactMetricsRegistry ;
362361 }
@@ -766,7 +765,8 @@ public UnleashConfig build() {
766765 proxy ,
767766 proxyAuthenticator ,
768767 startupExceptionHandler ,
769- impactMetricsRegistry );
768+ Optional .ofNullable (impactMetricsRegistry )
769+ .orElseGet (io .getunleash .impactmetrics .InMemoryMetricRegistry ::new ));
770770 }
771771
772772 public String getDefaultSdkVersion () {
0 commit comments