Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hackathon (Core) - Telemetry and analytics #31318

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

jgambarios
Copy link
Contributor

@jgambarios jgambarios commented Feb 6, 2025

Focusing on adding new event types and sources, and enhancing the CLI tool with analytics tracking capabilities. The most important changes include adding new event sources and types, creating a new analytics API, and modifying the CLI tool to support event recording.

Event Source and Type Additions:

Analytics API Implementation:

CLI Tool Enhancements:

Additional changes:

  • Tracking analytics on Future Time Machine

@jgambarios jgambarios marked this pull request as ready for review February 7, 2025 18:51
@jgambarios jgambarios marked this pull request as draft February 7, 2025 18:52
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class ContentAnalyticsUtil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doc me and probably helper will be a more accurate name



//Logging analytics for FTM if the publishing date is older than five minutes now
if (timeMachineDateInstant.isPresent() && isOlderThanFiveMinutes(timeMachineDateInstant.get())) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks such as the same code, so may want to encapsulate in a method

@@ -223,6 +226,10 @@ private MetricStatsCollector() {
metricStatsCollectors.add(new CountOfTimeFieldsMetricType());
metricStatsCollectors.add(new CountOfWYSIWYGFieldsMetricType());

metricStatsCollectors.add(new TotalSitesUsingDotaiMetricType());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to DotAI

import java.util.Map;
import java.util.Optional;

public class TotalEmbeddingsIndexesMetricType implements MetricType {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doc

import java.util.Optional;
import java.util.Set;

public class TotalSitesUsingDotaiMetricType implements MetricType {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doc me

return Optional.of(new MetricValue(this.getMetric(), sitesWithConfigurations.size()));
} catch (final DotSecurityException e) {
throw new DotDataException(e);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

finally here to destroy the secrets

import java.util.Optional;
import java.util.Set;

public class TotalSitesWithAutoIndexContentConfigMetricType implements MetricType {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docme

return Optional.of(new MetricValue(this.getMetric(), counter));
} catch (final DotSecurityException e) {
throw new DotDataException(e);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

finally delete secrets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants