Skip to content

Commit

Permalink
EPMRPP-88736 implement send analytics job
Browse files Browse the repository at this point in the history
  • Loading branch information
grabsefx committed Jun 27, 2024
1 parent 134e2d7 commit a325f56
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ public void execute() {
queryParams.addValue(DATE_BEFORE, dateBefore);

namedParameterJdbcTemplate.query(SELECT_ANALYZER_MANUAL_START_QUERY, queryParams, rs -> {
JSONObject requestBody = new JSONObject();

int autoAnalyzed = 0;
int userAnalyzed = 0;
String version = null;
Expand Down Expand Up @@ -129,10 +127,10 @@ public void execute() {

} while (rs.next());

var instanceID = jdbcTemplate.queryForObject(SELECT_INSTANCE_ID_QUERY, String.class);
var instanceId = jdbcTemplate.queryForObject(SELECT_INSTANCE_ID_QUERY, String.class);
var params = new JSONObject();
params.put("category", "analyzer");
params.put("instanceID", instanceID);
params.put("instanceID", instanceId);
params.put("timestamp", now.toEpochMilli());
params.put("version", version); // get from table
params.put("type", analyzerEnabled ? "is_analyzer" : "not_analyzer");
Expand All @@ -149,6 +147,7 @@ public void execute() {
JSONArray events = new JSONArray();
events.put(event);

JSONObject requestBody = new JSONObject();
requestBody.put("client_id",
now.toEpochMilli() + "." + RandomUtils.nextInt(100_000, 999_999));
requestBody.put("events", events);
Expand Down

0 comments on commit a325f56

Please sign in to comment.