aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-server-common
diff options
context:
space:
mode:
authorlukasz-jarocki-sonarsource <77498856+lukasz-jarocki-sonarsource@users.noreply.github.com>2022-02-03 10:35:15 +0100
committersonartech <sonartech@sonarsource.com>2022-02-18 15:48:03 +0000
commite04d2b354591a5e19fa6ae2e489abcd7f2712547 (patch)
tree7166e4f1d4f3e75772f7861ad3dfac5e096809d1 /server/sonar-server-common
parent33901a8a3f5a484bacbf9bdd7d1f9f994c4a0bfd (diff)
downloadsonarqube-e04d2b354591a5e19fa6ae2e489abcd7f2712547.tar.gz
sonarqube-e04d2b354591a5e19fa6ae2e489abcd7f2712547.zip
Added monitoring and telemetry to SonarLint push feature. (#5315)
* SONAR-15921 add number of connected sonarlint clients to telemetry
Diffstat (limited to 'server/sonar-server-common')
-rw-r--r--server/sonar-server-common/src/main/java/org/sonar/server/telemetry/TelemetryData.java12
-rw-r--r--server/sonar-server-common/src/test/java/org/sonar/server/telemetry/TelemetryDataJsonWriterTest.java1
2 files changed, 13 insertions, 0 deletions
diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/telemetry/TelemetryData.java b/server/sonar-server-common/src/main/java/org/sonar/server/telemetry/TelemetryData.java
index 3f6d947a20a..89d5f724130 100644
--- a/server/sonar-server-common/src/main/java/org/sonar/server/telemetry/TelemetryData.java
+++ b/server/sonar-server-common/src/main/java/org/sonar/server/telemetry/TelemetryData.java
@@ -54,6 +54,7 @@ public class TelemetryData {
private final Boolean hasUnanalyzedCpp;
private final List<String> customSecurityConfigs;
private final long sonarlintWeeklyUsers;
+ private final long numberOfConnectedSonarLintClients;
private TelemetryData(Builder builder) {
serverId = builder.serverId;
@@ -79,6 +80,7 @@ public class TelemetryData {
externalAuthenticationProviders = builder.externalAuthenticationProviders;
projectCountByScm = builder.projectCountByScm;
projectCountByCi = builder.projectCountByCi;
+ numberOfConnectedSonarLintClients = builder.numberOfConnectedSonarLintClients;
}
public String getServerId() {
@@ -101,6 +103,10 @@ public class TelemetryData {
return sonarlintWeeklyUsers;
}
+ public long sonarLintConnectedClients() {
+ return numberOfConnectedSonarLintClients;
+ }
+
public long getUserCount() {
return userCount;
}
@@ -199,6 +205,7 @@ public class TelemetryData {
private List<String> externalAuthenticationProviders;
private Map<String, Long> projectCountByScm;
private Map<String, Long> projectCountByCi;
+ private long numberOfConnectedSonarLintClients;
private Builder() {
// enforce static factory method
@@ -309,6 +316,11 @@ public class TelemetryData {
return this;
}
+ Builder setNumberOfConnectedSonarLintClients(long numberOfConnectedSonarLintClients) {
+ this.numberOfConnectedSonarLintClients = numberOfConnectedSonarLintClients;
+ return this;
+ }
+
TelemetryData build() {
requireNonNull(serverId);
requireNonNull(version);
diff --git a/server/sonar-server-common/src/test/java/org/sonar/server/telemetry/TelemetryDataJsonWriterTest.java b/server/sonar-server-common/src/test/java/org/sonar/server/telemetry/TelemetryDataJsonWriterTest.java
index 807625a31c1..aa280713ec1 100644
--- a/server/sonar-server-common/src/test/java/org/sonar/server/telemetry/TelemetryDataJsonWriterTest.java
+++ b/server/sonar-server-common/src/test/java/org/sonar/server/telemetry/TelemetryDataJsonWriterTest.java
@@ -60,6 +60,7 @@ public class TelemetryDataJsonWriterTest {
.setExternalAuthenticationProviders(asList("github", "gitlab"))
.setProjectCountByScm(Collections.emptyMap())
.setSonarlintWeeklyUsers(10)
+ .setNumberOfConnectedSonarLintClients(5)
.setProjectCountByCi(Collections.emptyMap())
.setDatabase(new TelemetryData.Database("H2", "11"))
.setUsingBranches(true);