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