org.intermine.api.tracker.TemplatesExecutionMap.getLogarithmMap java code examples | Tabnine

/**
 * Return a map containing the logarithm of accesses for each template. The map is obtained
 * merging the map of logarithm of accesses for single users and the map of logarithm of
 * accesses for the single sessions
 * @param userName the user name
 * @param sessionId the http session identifier
 * @param templateManager the template manager used to retrieve the global templates
 * @return map of logarithm of accesses
 */
public Map<String, Double> getLogarithmMap(String userName, String sessionId,
                      TemplateManager templateManager) {
  Map<String, Double> logarithmMap;
  if (userName == null && sessionId == null) {
    logarithmMap = templatesExecutionCache.getLogarithmMap(null, templateManager);
  } else {
    Map<String, Double> executionsByUser = new HashMap<String, Double>();
    Map<String, Double> executionsBySessionId = new HashMap<String, Double>();
    executionsByUser = templatesExecutionCache.getLogarithmMap(userName, templateManager);
    executionsBySessionId = templatesExecutionCache.getLogarithmMap(sessionId,
                                    templateManager);
    logarithmMap = mergeMap(executionsByUser, executionsBySessionId);
  }
  return logarithmMap;
}

Read more here: Source link