From a325f56b1f954070680528ab7731e4689bc2b24c Mon Sep 17 00:00:00 2001 From: siarhei_hrabko Date: Thu, 27 Jun 2024 11:53:00 +0300 Subject: [PATCH] EPMRPP-88736 implement send analytics job --- .../jobs/statistics/ManualLaunchStatisticsJob.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/epam/reportportal/jobs/statistics/ManualLaunchStatisticsJob.java b/src/main/java/com/epam/reportportal/jobs/statistics/ManualLaunchStatisticsJob.java index 89cde53..24f6f91 100644 --- a/src/main/java/com/epam/reportportal/jobs/statistics/ManualLaunchStatisticsJob.java +++ b/src/main/java/com/epam/reportportal/jobs/statistics/ManualLaunchStatisticsJob.java @@ -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; @@ -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"); @@ -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);