提交 f8df1cd4 编写于 作者: D Daniel Beck

Address review feedback

上级 2b618f36
......@@ -179,6 +179,7 @@ import org.kohsuke.accmod.restrictions.DoNotUse;
@SuppressWarnings("rawtypes")
public class Functions {
private static final AtomicLong iota = new AtomicLong();
private static Logger LOGGER = Logger.getLogger(Functions.class.getName());
public Functions() {
}
......@@ -651,7 +652,7 @@ public class Functions {
try {
ExtensionList.lookupSingleton(AutoRefresh.class).recordRequest(request, refresh);
} catch (Exception e) {
// ignore telemetry problems
LOGGER.log(Level.FINE, "Failed to record auto refresh status in telemetry", e);
}
}
......
......@@ -54,7 +54,7 @@ public class AutoRefresh extends Telemetry {
@Nonnull
@Override
public String getDisplayName() {
return "Use of auto refresh feature";
return Messages.AutoRefresh_DisplayName();
}
@Nonnull
......@@ -66,7 +66,7 @@ public class AutoRefresh extends Telemetry {
@Nonnull
@Override
public LocalDate getEnd() {
return LocalDate.of(2019, 4, 10);
return LocalDate.of(2019, 5, 31);
}
@Override
......@@ -74,8 +74,11 @@ public class AutoRefresh extends Telemetry {
if (sessionsBySetting.size() == 0) {
return null;
}
Map<Boolean, Set<String>> currentSessions = new TreeMap<>(sessionsBySetting);
sessionsBySetting.clear();
Map<Boolean, Set<String>> currentSessions;
synchronized (sessionsBySetting) {
currentSessions = new TreeMap<>(sessionsBySetting);
sessionsBySetting.clear();
}
JSONObject payload = new JSONObject();
for (Map.Entry<Boolean, Set<String>> entry : currentSessions.entrySet()) {
......@@ -94,8 +97,10 @@ public class AutoRefresh extends Telemetry {
HttpSession session = request.getSession(false);
if (session != null) {
String sessionId = session.getId();
sessionsBySetting.putIfAbsent(enabled, new HashSet<>());
sessionsBySetting.get(enabled).add(sessionId);
synchronized (sessionsBySetting) {
sessionsBySetting.putIfAbsent(enabled, new HashSet<>());
sessionsBySetting.get(enabled).add(sessionId);
}
}
}
}
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core">
This trial collects information about the "Auto Refresh" feature to determine whether use of the feature is used enough to not remove it in a future release of Jenkins.
This trial collects information about the "Auto Refresh" feature to determine whether the feature is used enough to not remove it in a future release of Jenkins.
We collect the number of HTTP sessions that have the feature (typically controlled via a cookie) enabled or disabled.
</j:jelly>
AutoRefresh.DisplayName = Use of auto refresh feature
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册