File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
core/src/main/java/dev/faststats/core Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -35,12 +35,13 @@ public void trackError(final Throwable error) {
3535 }
3636 }
3737
38- public JsonArray getData () {
38+ public JsonArray getData (final String buildId ) {
3939 final var report = new JsonArray (reports .size ());
4040
4141 reports .forEach ((hash , object ) -> {
4242 final var copy = object .deepCopy ();
4343 copy .addProperty ("hash" , hash );
44+ copy .addProperty ("buildId" , buildId );
4445 final var count = collected .getOrDefault (hash , 1 );
4546 if (count > 1 ) copy .addProperty ("count" , count );
4647 report .add (copy );
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ public abstract class SimpleMetrics implements Metrics {
5151
5252 private final String SDK_NAME ;
5353 private final String SDK_VERSION ;
54+ private final String BUILD_ID ;
5455
5556 {
5657 final var properties = new Properties ();
@@ -60,6 +61,7 @@ public abstract class SimpleMetrics implements Metrics {
6061 }
6162 this .SDK_NAME = properties .getProperty ("name" , "unknown" );
6263 this .SDK_VERSION = properties .getProperty ("version" , "unknown" );
64+ this .BUILD_ID = properties .getProperty ("build-id" , "unknown" );
6365 }
6466
6567 @ Contract (mutates = "io" )
@@ -278,7 +280,7 @@ protected JsonObject createData() {
278280 data .add ("data" , metrics );
279281
280282 getErrorTracker ().map (SimpleErrorTracker .class ::cast )
281- .map (SimpleErrorTracker :: getData )
283+ .map (tracker -> tracker . getData ( BUILD_ID ) )
282284 .filter (errors -> !errors .isEmpty ())
283285 .ifPresent (errors -> data .add ("errors" , errors ));
284286 return data ;
You can’t perform that action at this time.
0 commit comments