|
3 | 3 | import com.fasterxml.jackson.core.JsonProcessingException; |
4 | 4 | import com.fasterxml.jackson.databind.ObjectMapper; |
5 | 5 | import com.uid2.operator.Const; |
| 6 | +import com.uid2.operator.Main; |
6 | 7 | import com.uid2.operator.model.*; |
7 | 8 | import com.uid2.operator.model.IdentityScope; |
8 | 9 | import com.uid2.operator.monitoring.IStatsCollectorQueue; |
@@ -115,6 +116,7 @@ public class UIDOperatorVerticle extends AbstractVerticle { |
115 | 116 | private final Map<String, Counter> _tokenGenerateTCFUsage = new HashMap<>(); |
116 | 117 | private final Map<String, Tuple.Tuple2<Counter, Counter>> _identityMapUnmappedIdentifiers = new HashMap<>(); |
117 | 118 | private final Map<String, Counter> _identityMapRequestWithUnmapped = new HashMap<>(); |
| 119 | + private final Map<Tuple.Tuple2<String, String>, Counter> _clientVersions = new HashMap<>(); |
118 | 120 |
|
119 | 121 | private final Map<String, DistributionSummary> optOutStatusCounters = new HashMap<>(); |
120 | 122 | private final IdentityScope identityScope; |
@@ -218,6 +220,8 @@ public void start(Promise<Void> startPromise) throws Exception { |
218 | 220 | .listen(port, result -> { |
219 | 221 | if (result.succeeded()) { |
220 | 222 | this.healthComponent.setHealthStatus(true); |
| 223 | + // Record startup completion now that HTTP server is ready |
| 224 | + Main.recordStartupComplete(); |
221 | 225 | startPromise.complete(); |
222 | 226 | } else { |
223 | 227 | this.healthComponent.setHealthStatus(false, result.cause().getMessage()); |
@@ -788,12 +792,11 @@ private void handleHealthCheck(RoutingContext rc) { |
788 | 792 | } |
789 | 793 | } |
790 | 794 |
|
791 | | - private static final Map<Tuple.Tuple2<String, String>, Counter> CLIENT_VERSION_COUNTERS = new HashMap<>(); |
792 | 795 | private void recordOperatorServedSdkUsage(RoutingContext rc, Integer siteId, String apiContact, String clientVersion) { |
793 | 796 | if (siteId != null && apiContact != null && clientVersion != null) { |
794 | 797 | final String path = RoutingContextUtil.getPath(rc); |
795 | 798 |
|
796 | | - CLIENT_VERSION_COUNTERS.computeIfAbsent( |
| 799 | + _clientVersions.computeIfAbsent( |
797 | 800 | new Tuple.Tuple2<>(Integer.toString(siteId), clientVersion), |
798 | 801 | tuple -> Counter |
799 | 802 | .builder("uid2_client_sdk_versions_total") |
|
0 commit comments