mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-08 01:07:54 +00:00
fix: cleanup commented out dead code (#14188)
This commit is contained in:
parent
778f0f8d1c
commit
b486bccbb3
@ -154,56 +154,6 @@ public class TrackingService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: No callers: Remove post review
|
|
||||||
/*
|
|
||||||
public void track(
|
|
||||||
@Nonnull final String eventName,
|
|
||||||
@Nonnull final OperationContext opContext,
|
|
||||||
@Nullable final Authenticator authenticator,
|
|
||||||
@Nullable final EntityClient entityClient) {
|
|
||||||
if (mixpanelAPI == null || messageBuilder == null) {
|
|
||||||
log.warn("Mixpanel tracking is not enabled. Skipping event: {}", eventName);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
final String actorId = opContext.getActorContext().getActorUrn().toString();
|
|
||||||
|
|
||||||
// Create the event message using MessageBuilder
|
|
||||||
JSONObject message = messageBuilder.event(actorId, eventName, new JSONObject());
|
|
||||||
|
|
||||||
// Create properties object if it doesn't exist
|
|
||||||
JSONObject properties;
|
|
||||||
if (message.has("properties")) {
|
|
||||||
properties = message.getJSONObject("properties");
|
|
||||||
} else {
|
|
||||||
properties = new JSONObject();
|
|
||||||
message.put("properties", properties);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add properties to the event
|
|
||||||
properties.put("distinct_id", actorId);
|
|
||||||
properties.put("actor", actorId);
|
|
||||||
properties.put("version", _gitVersion.getVersion());
|
|
||||||
properties.put("time", System.currentTimeMillis() / 1000L);
|
|
||||||
|
|
||||||
// Sanitize the properties
|
|
||||||
JSONObject sanitizedProperties = sanitizeEvent(properties);
|
|
||||||
if (sanitizedProperties != null) {
|
|
||||||
message.put("properties", sanitizedProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
// log the message
|
|
||||||
log.info("Sending event {} to Mixpanel: {}", eventName, message.toString());
|
|
||||||
mixpanelAPI.sendMessage(message);
|
|
||||||
log.debug("Successfully sent event {} to Mixpanel", eventName);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.warn("Failed to track event: {}", eventName, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse a timestamp from various formats (numeric or string) and convert it to epoch milliseconds
|
* Parse a timestamp from various formats (numeric or string) and convert it to epoch milliseconds
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user