Skip to content

Commit

Permalink
feat(bootstrap): Refactor telemetry point capture
Browse files Browse the repository at this point in the history
  • Loading branch information
PerfectSlayer committed Dec 3, 2024
1 parent 315d472 commit bc778d3
Showing 1 changed file with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,13 @@ public void initMetaInfo(String attr, String value) {

@Override
public void onAbort(String reasonCode) {
synchronized (this.points) {
this.points.add("library_entrypoint.abort");
this.points.add("reason:" + reasonCode);
}
onPoint("library_entrypoint.abort", "reason:" + reasonCode);
markIncomplete();
}

@Override
public void onError(Throwable t) {
synchronized (this.points) {
this.points.add("library_entrypoint.error");
this.points.add("error_type:" + t.getClass().getName());
}
onPoint("library_entrypoint.error", "error_type:" + t.getClass().getName());
}

@Override
Expand All @@ -132,9 +126,13 @@ public void onFatalError(Throwable t) {

@Override
public void onError(String reasonCode) {
onPoint("library_entrypoint.error", "error_type:" + reasonCode);
}

private void onPoint(String name, String tag) {
synchronized (this.points) {
this.points.add("library_entrypoint.error");
this.points.add("error_type:" + reasonCode);
this.points.add(name);
this.points.add(tag);
}
}

Expand Down

0 comments on commit bc778d3

Please sign in to comment.