Skip to content
Permalink
Browse files

util: remove some more compile time

  • Loading branch information...
carl-mastrangelo committed Oct 22, 2019
1 parent 5d95a3e commit 8b9325bde4c5aaa3f286f21c9dc8231db43de8ad
Showing with 4 additions and 6 deletions.
  1. +4 −6 util/src/main/java/io/perfmark/util/PerfMarkUtil.java
@@ -16,7 +16,6 @@

package io.perfmark.util;

import com.google.errorprone.annotations.CompileTimeConstant;
import com.google.errorprone.annotations.MustBeClosed;
import io.perfmark.PerfMark;
import io.perfmark.Tag;
@@ -28,8 +27,7 @@
void run() throws E;
}

public static <T> T recordTaskResult(
@CompileTimeConstant String taskName, Tag tag, Supplier<T> cmd) {
public static <T> T recordTaskResult(String taskName, Tag tag, Supplier<T> cmd) {
PerfMark.startTask(taskName, tag);
try {
return cmd.get();
@@ -39,7 +37,7 @@
}

public static <E extends Exception> void recordTask(
@CompileTimeConstant String taskName, Tag tag, CheckedRunnable<E> cmd) throws E {
String taskName, Tag tag, CheckedRunnable<E> cmd) throws E {
PerfMark.startTask(taskName, tag);
try {
cmd.run();
@@ -49,13 +47,13 @@
}

@MustBeClosed
public static TaskRecorder recordTask(@CompileTimeConstant String taskName) {
public static TaskRecorder recordTask(String taskName) {
PerfMark.startTask(taskName);
return () -> PerfMark.stopTask(taskName);
}

@MustBeClosed
public static TaskRecorder recordTask(@CompileTimeConstant String taskName, Tag tag) {
public static TaskRecorder recordTask(String taskName, Tag tag) {
PerfMark.startTask(taskName, tag);
return () -> PerfMark.stopTask(taskName, tag);
}

0 comments on commit 8b9325b

Please sign in to comment.
You can’t perform that action at this time.