1/* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is distributed on an "AS IS" BASIS,
11WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.
14==============================================================================*/
15#include "tensorflow/core/data/stats_utils.h"
16
17#include "absl/base/attributes.h"
18#include "tensorflow/core/lib/strings/strcat.h"
19
20namespace tensorflow {
21namespace data {
22namespace stats_utils {
23
24ABSL_CONST_INIT const char kDelimiter[] = "::";
25ABSL_CONST_INIT const char kExecutionTime[] = "execution_time";
26ABSL_CONST_INIT const char kThreadUtilization[] = "thread_utilization";
27ABSL_CONST_INIT const char kBufferSize[] = "buffer_size";
28ABSL_CONST_INIT const char kBufferCapacity[] = "buffer_capacity";
29ABSL_CONST_INIT const char kBufferUtilization[] = "buffer_utilization";
30ABSL_CONST_INIT const char kFilteredElements[] = "filtered_elements";
31ABSL_CONST_INIT const char kDroppedElements[] = "dropped_elements";
32ABSL_CONST_INIT const char kFeaturesCount[] = "features_count";
33ABSL_CONST_INIT const char kFeatureValuesCount[] = "feature_values_count";
34ABSL_CONST_INIT const char kExamplesCount[] = "examples_count";
35
36string ExecutionTimeHistogramName(const string& prefix) {
37 return strings::StrCat(prefix, kDelimiter, kExecutionTime);
38}
39
40string ThreadUtilizationScalarName(const string& prefix) {
41 return strings::StrCat(prefix, kDelimiter, kThreadUtilization);
42}
43
44string BufferSizeScalarName(const string& prefix) {
45 return strings::StrCat(prefix, kDelimiter, kBufferSize);
46}
47
48string BufferCapacityScalarName(const string& prefix) {
49 return strings::StrCat(prefix, kDelimiter, kBufferCapacity);
50}
51
52string BufferUtilizationHistogramName(const string& prefix) {
53 return strings::StrCat(prefix, kDelimiter, kBufferUtilization);
54}
55
56string FilterdElementsScalarName(const string& prefix) {
57 return strings::StrCat(prefix, kDelimiter, kFilteredElements);
58}
59
60string DroppedElementsScalarName(const string& prefix) {
61 return strings::StrCat(prefix, kDelimiter, kDroppedElements);
62}
63
64string FeatureHistogramName(const string& prefix) {
65 return strings::StrCat(prefix, kDelimiter, kFeaturesCount);
66}
67
68string FeatureValueHistogramName(const string& prefix) {
69 return strings::StrCat(prefix, kDelimiter, kFeatureValuesCount);
70}
71
72} // namespace stats_utils
73} // namespace data
74} // namespace tensorflow
75