APISonar


org.apache.gobblin.metrics.ContextAwareTimer.time

> org > apache > gobblin > metrics > ContextAwareTimer > time
org APIs apache APIs gobblin APIs metrics APIs ContextAwareTimer APIs time APIs

Example 1
protected final ContextAwareTimer deleteTimer;

  public boolean delete (Path f, boolean recursive) throws  IOException {
    try (Closeable context = new TimerContextWithLog(deleteTimer.time(), "delete", f, recursive)) {
      return super.delete (f, recursive);
    }
  }
Example 2
protected final ContextAwareTimer renameTimer;

  public boolean rename (Path src, Path dst) throws IOException {
    try (Closeable context =  new TimerContextWithLog(renameTimer.time(), "rename", src, dst)) {
      return super.rename(src, dst);
    }
  }
Example 3
protected final ContextAwareTimer mkdirTimer;

  public boolean mkdirs(Path f, FsPermission permission) throws IOException {
    try (Closeable context = new TimerContextWithLog(mkdirTimer.time(), "mkdirs", f, permission)) {
      return super.mkdirs (f, permission);
    }
  }
Example 4
protected final ContextAwareTimer listStatusTimer;

  public FileStatus[] listStatus(Path path) throws IOException {
   try (TimerContextWithLog context = new TimerContextWithLog(listStatusTimer.time(), "listStatus", path)) {
      FileStatus[] statuses = super.listStatus(path);
      context.setResult(statuses);
      return statuses;
    }
  }
Example 5
protected final ContextAwareTimer globStatusTimer;

  public FileStatus[] globStatus(Path pathPattern) throws IOException {
    try (TimerContextWithLog context = new TimerContextWithLog(globStatusTimer.time(), "globStatus", pathPattern)) {
      FileStatus[] statuses = super.globStatus(pathPattern);
      context.setResult(statuses);
      return statuses;
    }
  }