Skip to content

Commit

Permalink
Add three new metrics queries
Browse files Browse the repository at this point in the history
  • Loading branch information
holmbergius committed Sep 22, 2024
1 parent b723d55 commit c3869f0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main/java/org/ecocean/MetricsBot.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c3869f0

Please sign in to comment.