From c3869f091476cd00e626555417e2978bd9e594ee Mon Sep 17 00:00:00 2001 From: holmbergius Date: Sun, 22 Sep 2024 16:17:57 -0700 Subject: [PATCH] Add three new metrics queries --- src/main/java/org/ecocean/MetricsBot.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/org/ecocean/MetricsBot.java b/src/main/java/org/ecocean/MetricsBot.java index e41b782bfc..dbd8805061 100644 --- a/src/main/java/org/ecocean/MetricsBot.java +++ b/src/main/java/org/ecocean/MetricsBot.java @@ -287,6 +287,19 @@ else if (contributorsLabels.endsWith(",")) { "SELECT count(this) FROM org.ecocean.User WHERE username == null", "wildbook_datacontributors_total", "Number of public data contributors", context, contributorsLabels)); + + //Issue 532 - find number Encounters owned by User 'public' + csvLines.add(buildGauge("SELECT count(this) FROM org.ecocean.Encounter where submitterID == 'public'", + "wildbook_encounters_public_owned_total", "Number of public owned encounters", context, encLabels)); + + //Issue 532 - number of encounters submitted by researcher: encounters submitted by accounts that have researcher role + csvLines.add(buildGauge("SELECT count(this) FROM org.ecocean.Encounter where submitterID == role.username && role.rolename=='researcher' VARIABLES org.ecocean.Role role", + "wildbook_encounters_researcher_owned_total", "Number of researcher owned encounters", context, encLabels)); + + //Issue 532 - number of encounters submitted by citizen scientist: encounters submitted by accounts that do not have a role + csvLines.add(buildGauge("SELECT count(this) FROM org.ecocean.Encounter where submitterID == null || submitterID == 'public' || !(select distinct username from org.ecocean.Role where rolename=='researcher').contains(submitterID)", + "wildbook_encounters_citsci_contributed_total", "Number of citizen science contributed encounters", context, encLabels)); + // Machine learning tasks addTasksToCsv(csvLines, context);