com.atlassian.util.profiling.UtilTimerStack.pop()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(10.0k)|赞(0)|评价(0)|浏览(68)

本文整理了Java中com.atlassian.util.profiling.UtilTimerStack.pop()方法的一些代码示例,展示了UtilTimerStack.pop()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UtilTimerStack.pop()方法的具体详情如下:
包路径:com.atlassian.util.profiling.UtilTimerStack
类名称:UtilTimerStack
方法名:pop

UtilTimerStack.pop介绍

暂无

代码示例

代码示例来源:origin: com.atlassian.bonnie/atlassian-bonnie

@Override
  public void unlock()
  {
    if (log.isDebugEnabled())
      log.debug("Releasing lock: " + name);
    super.unlock();
    UtilTimerStack.pop(getClass().getName() + "." + name);
  }
}

代码示例来源:origin: com.atlassian.user/atlassian-user-core

public static void pop(Supplier<String> supplier) {
    if (UtilTimerStack.isActive()) {
      UtilTimerStack.pop(supplier.get());
    }
  }
}

代码示例来源:origin: com.atlassian.jira/jira-core

@Nonnull
@Override
public Set<Pair<Long, String>> getProjectIssueTypePairsByIds(@Nonnull final Set<Long> issueIds)
{
  if (issueIds.isEmpty())
    return new HashSet<>();
  UtilTimerStack.push("DefaultIssueManager.getProjectIssueTypePairsByIds()");
  EntityCondition condition = new EntityExpr("id", EntityOperator.IN, issueIds);
  Set<Pair<Long, String>> projectIssueTypePairsByIds =
      getProjectIssueTypePairs(Arrays.asList(IssueFieldConstants.PROJECT, "type"), condition);
  UtilTimerStack.pop("DefaultIssueManager.getProjectIssueTypePairsByIds()");
  return projectIssueTypePairsByIds;
}

代码示例来源:origin: com.atlassian.jira/jira-core

private Map<String, ProjectRoleActorModuleDescriptor> getImplementationsMap()
{
  UtilTimerStack.push("DefaultRoleActorFactory.getImplementations");
  UtilTimerStack.push("DefaultRoleActorFactory.getImplementations-getEnabledModuleDescriptorByClass");
  List<ProjectRoleActorModuleDescriptor> descriptors = pluginAccessor.getEnabledModuleDescriptorsByClass(ProjectRoleActorModuleDescriptor.class);
  UtilTimerStack.pop("DefaultRoleActorFactory.getImplementations-getEnabledModuleDescriptorByClass");
  Map<String, ProjectRoleActorModuleDescriptor> actorsByType = Maps.newHashMapWithExpectedSize(descriptors.size());
  for (final ProjectRoleActorModuleDescriptor projectRoleModuleDescriptor : descriptors)
  {
    actorsByType.put(projectRoleModuleDescriptor.getKey(), projectRoleModuleDescriptor);
  }
  UtilTimerStack.pop("DefaultRoleActorFactory.getImplementations");
  return actorsByType;
}

代码示例来源:origin: com.atlassian.jira.plugins/jira-fisheye-plugin

private void log(Response response) throws ResponseException
{
  if (log.isTraceEnabled())
  {
    String timerKey = "debug request.getResponseBodyAsString()";
    try
    {
      UtilTimerStack.push(timerKey);
      log.trace("Response: " + response.getResponseBodyAsString());
    }
    finally
    {
      UtilTimerStack.pop(timerKey);
    }
  }
}

代码示例来源:origin: com.atlassian.jira.plugins/jira-fisheye-plugin

private void log(Response response) throws ResponseException
{
  if (log.isTraceEnabled())
  {
    String timerKey = "debug request.getResponseBodyAsString()";
    try
    {
      UtilTimerStack.push(timerKey);
      log.trace("Response: " + response.getResponseBodyAsString());
    }
    finally
    {
      UtilTimerStack.pop(timerKey);
    }
  }
}

代码示例来源:origin: com.atlassian.xwork/atlassian-xwork-core

public void doExecute(String finalLocation, ActionInvocation invocation) throws Exception
{
  UtilTimerStack.push("XW View: doExecute(" + finalLocation + ")");
  try
  {
    super.doExecute(finalLocation, invocation);
  }
  finally
  {
    UtilTimerStack.pop("XW View: doExecute(" + finalLocation + ")");
  }
}

代码示例来源:origin: com.atlassian.xwork/atlassian-xwork-core

protected void after(ActionInvocation actionInvocation, String string) throws Exception
{
  UtilTimerStack.pop(makeStackKey(actionInvocation.getProxy()));
}

代码示例来源:origin: com.atlassian.xwork/atlassian-xwork-core

@Override
  protected Template getTemplate(ValueStack stack, VelocityEngine velocity, ActionInvocation invocation, String location, String encoding) throws Exception
  {
    UtilTimerStack.push("XW View: getTemplate(" + location + ")");
    try
    {
      return super.getTemplate(stack, velocity, invocation, location, encoding);
    }
    finally
    {
      UtilTimerStack.pop("XW View: getTemplate(" + location + ")");
    }
  }
}

代码示例来源:origin: com.atlassian.jira/jira-core

public List<QueryLiteral> getValues(final QueryCreationContext queryCreationContext, final MultiValueOperand operand, final TerminalClause terminalClause)
{
  UtilTimerStack.push("MultiValueOperandHandler.getValues()");
  final List<QueryLiteral> valuesList = Lists.newArrayListWithCapacity(operand.getValues().size());
  for (Operand subOperand : operand.getValues())
  {
    final List<QueryLiteral> vals = operandResolver.getValues(queryCreationContext, subOperand, terminalClause);
    if (vals != null)
    {
      valuesList.addAll(vals);
    }
  }
  UtilTimerStack.pop("MultiValueOperandHandler.getValues()");
  return valuesList;
}

代码示例来源:origin: com.atlassian.jira.plugins/jira-fisheye-plugin

public List<Changeset> searchForChangeSets(RepositoryPath path, int maxChangesets) throws IOException {
  List<String> csids = apiManager.callFisheye(path.getRep(), RestCommandFactory.changesets(path.getPath(), maxChangesets), CsIdFromChangesetsParser.PARSER);
  Iterator<String> iterator = csids.iterator();
  List<Changeset> changesets = new ArrayList<Changeset>(csids.size());
  String changesetTimerKey = "ChangeSetManager.searchForChangeSets(RepositoryPath, int) path=" + path + " maxchangesets=" + maxChangesets;
  try {
    UtilTimerStack.push(changesetTimerKey);
    while (iterator.hasNext() && changesets.size() < maxChangesets) {
      String csid = iterator.next();
      changesets.add(getChangeset(path.getRep(), csid));
    }
  } finally {
    UtilTimerStack.pop(changesetTimerKey);
  }
  return changesets;
}

代码示例来源:origin: com.atlassian.confluence.extra/confluence-flyingpdf-plugin

public boolean exportableContentExists() {
  UtilTimerStack.push("BetterExportSpaceAction.exportableContentExists");
  boolean containsStuff = pdfExporterService.exportableContentExists(getSpace());
  UtilTimerStack.pop("BetterExportSpaceAction.exportableContentExists");
  return containsStuff;
}

代码示例来源:origin: com.atlassian.jira/jira-api

@Override
public String execute() throws Exception
{
  final String logLine = getActionName() + ".execute()";
  UtilTimerStack.push(logLine);
  try
  {
    return super.execute();
  }
  finally
  {
    UtilTimerStack.pop(logLine);
  }
}

代码示例来源:origin: com.atlassian.jira/jira-core

private void reindexIssue(Issue issue)
{
  String issueKey = issue.getString("key");
  try
  {
    // Reindex issue
    UtilTimerStack.push("Reindexing issue: " + issueKey);
    ComponentAccessor.getComponent(IssueIndexManager.class).reIndex(issue);
    UtilTimerStack.pop("Reindexing issue: " + issueKey);
  }
  catch (IndexException e)
  {
    log.error("Error occurred while reindexing issue: " + issueKey, e);
  }
}

代码示例来源:origin: com.atlassian.jira.plugins/jira-fisheye-plugin

public <T> List<T> callFisheye(FishEyeInstance instance, RestCommand<T> restCommand, ResponseParser<T> parser)
    throws IOException {
  final Document doc = callFisheye(instance, restCommand);
  final String timerKey = "callFisheye() " + parser.getClass().getSimpleName() + "().parse()";
  try {
    UtilTimerStack.push(timerKey);
    return parser.parse(new FishEyeDocumentHolder(doc, instance.getUrl(), instance.isCru()));
  } finally {
    UtilTimerStack.pop(timerKey);
  }
}

代码示例来源:origin: com.atlassian.confluence.extra/confluence-flyingpdf-plugin

@Override
public boolean isPermitted() {
  UtilTimerStack.push("BetterExportSpaceAction.isPermitted");
  boolean isPermitted = pdfExporterService.isPermitted(getRemoteUser(), getSpace());
  UtilTimerStack.pop("BetterExportSpaceAction.isPermitted");
  return isPermitted;
}

代码示例来源:origin: com.atlassian.jira.plugins/jira-fisheye-plugin

protected Revision getRevision(FishEyeRepository rep, String path, String rev) throws IOException {
  String timerKey = "ChangeSetManager.getRevision() rep=" + rep.getName() + " path=" + path + "@" + rev;
  try {
    UtilTimerStack.push(timerKey);
    Revision revision = cache.getRevision(rep, path, rev);
    if (revision == null) {
      List<Revision> revisionList = apiManager.callFisheye(rep, RestCommandFactory.revision(path, rev), new SingleRevisionParser(rep));
      revision = revisionList.get(0);
      cache.add(rep, revision);
    }
    return revision;
  } finally {
    UtilTimerStack.pop(timerKey);
  }
}

代码示例来源:origin: com.atlassian.jira.plugins/jira-fisheye-plugin

public List<Review> getReviewsForChangeset(final String projectKey, final String csid, final String repositoryName) throws IOException {
  final String timerKey = "ReviewManager.getReviewsForChangeset() rep=" + repositoryName + " projectKey=" + projectKey + " csid=" + csid;
  final EyeQLQuery query = new EyeQLQuery()
      .addWhereClause(WhereClauseFactory.csidIs(csid))
      .addReturnClause("reviews");
  try {
    UtilTimerStack.push(timerKey);
    return searchForReviews(projectKey, query, repositoryName);
  } finally {
    UtilTimerStack.pop(timerKey);
  }
}

代码示例来源:origin: com.atlassian.jira/jira-core

public Chart generateRecentlyCreated(final ChartContext context, final int days, final PeriodName periodName)
{
  UtilTimerStack.push("Generating Recently Created chart");
  try
  {
    final RecentlyCreatedChart recentlyCreatedChart = new RecentlyCreatedChart(searchProvider, issueIndexManager, searchService, applicationProperties, timeZoneManager);
    if (context.isInline())
    {
      return recentlyCreatedChart.generateInlineChart(context.getRemoteUser(), context.getSearchRequest(), days, periodName, context.getWidth(), context.getHeight());
    }
    return recentlyCreatedChart.generateChart(context.getRemoteUser(), context.getSearchRequest(), days, periodName, context.getWidth(), context.getHeight());
  }
  finally
  {
    UtilTimerStack.pop("Generating Recently Created chart");
  }
}

代码示例来源:origin: com.atlassian.jira/jira-core

public Chart generatePieChart(final ChartContext context, final String statisticType)
{
  UtilTimerStack.push("Generating Pie chart");
  try
  {
    final PieChart pieChart = new PieChart(constantsManager, customFieldManager, searchService, applicationProperties);
    if (context.isInline())
    {
      return pieChart.generateInlineChart(context.getRemoteUser(), context.getSearchRequest(), statisticType, context.getWidth(), context.getHeight());
    }
    return pieChart.generateChart(context.getRemoteUser(), context.getSearchRequest(), statisticType, context.getWidth(), context.getHeight());
  }
  finally
  {
    UtilTimerStack.pop("Generating Pie chart");
  }
}

相关文章

微信公众号

最新文章

更多