aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/util/reporter.h
diff options
context:
space:
mode:
authorGravatar Shashi Shekhar <shashishekhar@google.com>2018-04-06 16:58:18 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-04-06 17:00:44 -0700
commitdbfc3d5d364a61dcf8b2867aee6afd6dc387b34b (patch)
tree4d87b839d417c7b0101694cfe02ab354e81e5afc /tensorflow/core/util/reporter.h
parentba17f2a81949a0b35a92a4d6f7704d0fb2917bd3 (diff)
Add methods to TestReporter to log extras for benchmarks.
PiperOrigin-RevId: 191960433
Diffstat (limited to 'tensorflow/core/util/reporter.h')
-rw-r--r--tensorflow/core/util/reporter.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/tensorflow/core/util/reporter.h b/tensorflow/core/util/reporter.h
index bcae12204e..e551e2e4f5 100644
--- a/tensorflow/core/util/reporter.h
+++ b/tensorflow/core/util/reporter.h
@@ -34,11 +34,13 @@ namespace tensorflow {
//
// If this environment variable is not defined, no logging is performed.
//
-// The intended use is via the following 4 lines:
+// The intended use is via the following lines:
//
// TestReporter reporter(test_name);
// TF_CHECK_OK(reporter.Initialize()));
// TF_CHECK_OK(reporter.Benchmark(iters, cpu_time, wall_time, throughput));
+// TF_CHECK_OK(reporter.SetProperty("some_string_property", "some_value");
+// TF_CHECK_OK(reporter.SetProperty("some_double_property", double_value);
// TF_CHECK_OK(reporter.Close());
//
// For example, if the environment variable
@@ -75,6 +77,12 @@ class TestReporter {
Status Benchmark(int64 iters, double cpu_time, double wall_time,
double throughput);
+ // Set property on Benchmark to the given value.
+ Status SetProperty(const string& name, double value);
+
+ // Set property on Benchmark to the given value.
+ Status SetProperty(const string& name, const string& value);
+
// TODO(b/32704451): Don't just ignore the ::tensorflow::Status object!
~TestReporter() { Close().IgnoreError(); } // Autoclose in destructor.