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 16 #ifndef TENSORFLOW_CORE_LIB_MONITORING_TYPES_H_ 17 #define TENSORFLOW_CORE_LIB_MONITORING_TYPES_H_ 18 19 #include <cmath> 20 #include <vector> 21 22 #include "tensorflow/core/platform/types.h" 23 24 namespace tensorflow { 25 namespace monitoring { 26 27 enum class UnitOfMeasure { 28 kNumber, 29 kTime, 30 kBytes, 31 }; 32 33 struct PercentilePoint { 34 // In the [0, 100] range. 35 double percentile = 0.0; 36 double value = 0.0; 37 }; 38 39 struct Percentiles { 40 UnitOfMeasure unit_of_measure = UnitOfMeasure::kNumber; 41 uint64 start_nstime = 0; 42 uint64 end_nstime = 0; 43 double min_value = NAN; 44 double max_value = NAN; 45 double mean = NAN; 46 double stddev = NAN; 47 size_t num_samples = 0; 48 size_t total_samples = 0; 49 long double accumulator = NAN; 50 std::vector<PercentilePoint> points; 51 }; 52 53 } // namespace monitoring 54 } // namespace tensorflow 55 56 #endif // TENSORFLOW_CORE_LIB_MONITORING_TYPES_H_ 57