Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a metric to measure how often study linkage is changed when importing flow data #717

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.labkey.api.security.permissions.UpdatePermission;
import org.labkey.api.study.Study;
import org.labkey.api.study.StudyService;
import org.labkey.api.usageMetrics.SimpleMetricsService;
import org.labkey.api.util.PageFlowUtil;
import org.labkey.api.util.Pair;
import org.labkey.api.util.URIUtil;
Expand All @@ -55,6 +56,7 @@
import org.labkey.api.view.RedirectException;
import org.labkey.api.view.ViewBackgroundInfo;
import org.labkey.api.view.template.PageConfig;
import org.labkey.flow.FlowModule;
import org.labkey.flow.FlowPreference;
import org.labkey.flow.analysis.model.ExternalAnalysis;
import org.labkey.flow.analysis.model.FCS;
Expand Down Expand Up @@ -1357,6 +1359,12 @@ private void stepChooseAnalysis(ImportAnalysisForm form, BindException errors)
}

Container targetStudy = getTargetStudy(form.getTargetStudy(), errors);
if (form.getStudyChanged())
{
// Estabilish & increment a metric to measure usage of the Study Linkage feature of the Flow data import process
SimpleMetricsService.get().increment(FlowModule.NAME, "SampleImport", "StudyLinkChanged");
}

if (errors.hasErrors())
return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ public enum SelectFCSFileOption implements SafeToRenderEnum
private String[] keywordDir;
private boolean confirm;

private boolean studyChanged = false;

public void setStudyChanged(boolean studyChanged)
{
this.studyChanged = studyChanged;
}

public boolean getStudyChanged()
{
return this.studyChanged;
}

public int getStep()
{
return step;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<input type="hidden" name="selectAnalysisEngine" id="selectAnalysisEngine" value="<%=form.getSelectAnalysisEngine()%>">

<input type="hidden" name="importGroupNames" value="<%=h(form.getImportGroupNames())%>"/>
<input type="hidden" name="studyChanged" id="studyChanged" value="<%=h(form.getStudyChanged())%>" />

<p>
<hr/>
Expand Down Expand Up @@ -232,7 +233,7 @@ if (form.getKeywordDir() != null && form.getKeywordDir().length > 0 && StudyPubl
<div style="padding-left: 2em; padding-bottom: 1em;">
<br>
Choose a target study folder:<br>
<%=select().name("targetStudy").className(null).addOptions(targetStudies).selected(text(form.getTargetStudy()))
<%=select().name("targetStudy").className(null).addOptions(targetStudies).selected(text(form.getTargetStudy())).onChange("document.getElementById('studyChanged').value = true;")
%>
<%-- <select id="targetStudy" name="targetStudy">--%>
<%-- <labkey:options value="<%=text(form.getTargetStudy())%>" map="<%=targetStudies%>"/>--%>
Expand Down