Ian Rogers | 4535705 | 2013-04-18 20:49:43 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2013 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Ian Rogers | 700a402 | 2014-05-19 16:49:03 -0700 | [diff] [blame] | 17 | #include <memory> |
| 18 | #include <sstream> |
| 19 | |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 20 | #include "gtest/gtest.h" |
| 21 | #include "histogram-inl.h" |
Ian Rogers | 4535705 | 2013-04-18 20:49:43 -0700 | [diff] [blame] | 22 | |
Brian Carlstrom | 3e3d591 | 2013-07-18 00:19:45 -0700 | [diff] [blame] | 23 | namespace art { |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 24 | |
Brian Carlstrom | 7934ac2 | 2013-07-26 10:54:15 -0700 | [diff] [blame] | 25 | // Simple usage: |
Mathieu Chartier | e5426c9 | 2013-08-01 13:55:42 -0700 | [diff] [blame] | 26 | // Histogram *hist(new Histogram("SimplePercentiles")); |
Brian Carlstrom | 7934ac2 | 2013-07-26 10:54:15 -0700 | [diff] [blame] | 27 | // Percentile PerValue |
| 28 | // hist->AddValue(121); |
| 29 | // hist->AddValue(132); |
| 30 | // hist->AddValue(140); |
| 31 | // hist->AddValue(145); |
| 32 | // hist->AddValue(155); |
| 33 | // hist->CreateHistogram(); |
| 34 | // PerValue = hist->PercentileVal(0.50); finds the 50th percentile(median). |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 35 | |
| 36 | TEST(Histtest, MeanTest) { |
Ian Rogers | 700a402 | 2014-05-19 16:49:03 -0700 | [diff] [blame] | 37 | std::unique_ptr<Histogram<uint64_t>> hist(new Histogram<uint64_t>("MeanTest", 5)); |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 38 | |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 39 | double mean; |
| 40 | for (size_t Idx = 0; Idx < 90; Idx++) { |
| 41 | hist->AddValue(static_cast<uint64_t>(50)); |
| 42 | } |
| 43 | mean = hist->Mean(); |
Ian Rogers | 647b1a8 | 2014-10-10 11:02:11 -0700 | [diff] [blame] | 44 | EXPECT_DOUBLE_EQ(mean, 50.0); |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 45 | hist->Reset(); |
| 46 | hist->AddValue(9); |
| 47 | hist->AddValue(17); |
| 48 | hist->AddValue(28); |
| 49 | hist->AddValue(28); |
| 50 | mean = hist->Mean(); |
Ian Rogers | 647b1a8 | 2014-10-10 11:02:11 -0700 | [diff] [blame] | 51 | EXPECT_DOUBLE_EQ(20.5, mean); |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 52 | } |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 53 | |
| 54 | TEST(Histtest, VarianceTest) { |
Ian Rogers | 700a402 | 2014-05-19 16:49:03 -0700 | [diff] [blame] | 55 | std::unique_ptr<Histogram<uint64_t>> hist(new Histogram<uint64_t>("VarianceTest", 5)); |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 56 | |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 57 | double variance; |
| 58 | hist->AddValue(9); |
| 59 | hist->AddValue(17); |
| 60 | hist->AddValue(28); |
| 61 | hist->AddValue(28); |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 62 | variance = hist->Variance(); |
Ian Rogers | 647b1a8 | 2014-10-10 11:02:11 -0700 | [diff] [blame] | 63 | EXPECT_DOUBLE_EQ(64.25, variance); |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 64 | } |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 65 | |
| 66 | TEST(Histtest, Percentile) { |
Ian Rogers | 700a402 | 2014-05-19 16:49:03 -0700 | [diff] [blame] | 67 | std::unique_ptr<Histogram<uint64_t>> hist(new Histogram<uint64_t>("Percentile", 5)); |
Mathieu Chartier | e5426c9 | 2013-08-01 13:55:42 -0700 | [diff] [blame] | 68 | Histogram<uint64_t>::CumulativeData data; |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 69 | |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 70 | double PerValue; |
| 71 | |
| 72 | hist->AddValue(20); |
| 73 | hist->AddValue(31); |
| 74 | hist->AddValue(42); |
| 75 | hist->AddValue(50); |
| 76 | hist->AddValue(60); |
| 77 | hist->AddValue(70); |
Sameer Abu Asal | c081e36 | 2013-02-20 16:45:38 -0800 | [diff] [blame] | 78 | |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 79 | hist->AddValue(98); |
Sameer Abu Asal | c081e36 | 2013-02-20 16:45:38 -0800 | [diff] [blame] | 80 | |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 81 | hist->AddValue(110); |
| 82 | hist->AddValue(121); |
| 83 | hist->AddValue(132); |
| 84 | hist->AddValue(140); |
| 85 | hist->AddValue(145); |
| 86 | hist->AddValue(155); |
| 87 | |
Ian Rogers | 500793f | 2013-11-14 17:49:12 -0800 | [diff] [blame] | 88 | hist->CreateHistogram(&data); |
Mathieu Chartier | e5426c9 | 2013-08-01 13:55:42 -0700 | [diff] [blame] | 89 | PerValue = hist->Percentile(0.50, data); |
Sameer Abu Asal | 857a078 | 2013-02-21 11:00:20 -0800 | [diff] [blame] | 90 | EXPECT_EQ(875, static_cast<int>(PerValue * 10)); |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 91 | } |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 92 | |
| 93 | TEST(Histtest, UpdateRange) { |
Ian Rogers | 700a402 | 2014-05-19 16:49:03 -0700 | [diff] [blame] | 94 | std::unique_ptr<Histogram<uint64_t>> hist(new Histogram<uint64_t>("UpdateRange", 5)); |
Mathieu Chartier | e5426c9 | 2013-08-01 13:55:42 -0700 | [diff] [blame] | 95 | Histogram<uint64_t>::CumulativeData data; |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 96 | |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 97 | double PerValue; |
| 98 | |
| 99 | hist->AddValue(15); |
| 100 | hist->AddValue(17); |
| 101 | hist->AddValue(35); |
| 102 | hist->AddValue(50); |
| 103 | hist->AddValue(68); |
| 104 | hist->AddValue(75); |
| 105 | hist->AddValue(93); |
| 106 | hist->AddValue(110); |
| 107 | hist->AddValue(121); |
| 108 | hist->AddValue(132); |
Brian Carlstrom | 7934ac2 | 2013-07-26 10:54:15 -0700 | [diff] [blame] | 109 | hist->AddValue(140); // Median value |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 110 | hist->AddValue(145); |
| 111 | hist->AddValue(155); |
| 112 | hist->AddValue(163); |
| 113 | hist->AddValue(168); |
| 114 | hist->AddValue(175); |
| 115 | hist->AddValue(182); |
| 116 | hist->AddValue(193); |
| 117 | hist->AddValue(200); |
| 118 | hist->AddValue(205); |
| 119 | hist->AddValue(212); |
Ian Rogers | 500793f | 2013-11-14 17:49:12 -0800 | [diff] [blame] | 120 | hist->CreateHistogram(&data); |
Mathieu Chartier | e5426c9 | 2013-08-01 13:55:42 -0700 | [diff] [blame] | 121 | PerValue = hist->Percentile(0.50, data); |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 122 | |
| 123 | std::string text; |
| 124 | std::stringstream stream; |
Mathieu Chartier | 3e669db | 2013-11-20 15:51:12 -0800 | [diff] [blame] | 125 | std::string expected("UpdateRange:\tSum: 2.654ms 99% C.I. 15us-212us Avg: 126.380us Max: 212us\n"); |
Mathieu Chartier | e5426c9 | 2013-08-01 13:55:42 -0700 | [diff] [blame] | 126 | hist->PrintConfidenceIntervals(stream, 0.99, data); |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 127 | |
| 128 | EXPECT_EQ(expected, stream.str()); |
| 129 | EXPECT_GE(PerValue, 132); |
| 130 | EXPECT_LE(PerValue, 145); |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 131 | } |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 132 | |
| 133 | TEST(Histtest, Reset) { |
Ian Rogers | 700a402 | 2014-05-19 16:49:03 -0700 | [diff] [blame] | 134 | std::unique_ptr<Histogram<uint64_t>> hist(new Histogram<uint64_t>("Reset", 5)); |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 135 | |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 136 | double PerValue; |
| 137 | hist->AddValue(0); |
| 138 | hist->AddValue(189); |
| 139 | hist->AddValue(389); |
| 140 | hist->Reset(); |
| 141 | hist->AddValue(15); |
| 142 | hist->AddValue(17); |
| 143 | hist->AddValue(35); |
| 144 | hist->AddValue(50); |
| 145 | hist->AddValue(68); |
| 146 | hist->AddValue(75); |
| 147 | hist->AddValue(93); |
| 148 | hist->AddValue(110); |
| 149 | hist->AddValue(121); |
| 150 | hist->AddValue(132); |
Brian Carlstrom | 7934ac2 | 2013-07-26 10:54:15 -0700 | [diff] [blame] | 151 | hist->AddValue(140); // Median value |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 152 | hist->AddValue(145); |
| 153 | hist->AddValue(155); |
| 154 | hist->AddValue(163); |
| 155 | hist->AddValue(168); |
| 156 | hist->AddValue(175); |
| 157 | hist->AddValue(182); |
| 158 | hist->AddValue(193); |
| 159 | hist->AddValue(200); |
| 160 | hist->AddValue(205); |
| 161 | hist->AddValue(212); |
Ian Rogers | 500793f | 2013-11-14 17:49:12 -0800 | [diff] [blame] | 162 | Histogram<uint64_t>::CumulativeData data; |
| 163 | hist->CreateHistogram(&data); |
Mathieu Chartier | e5426c9 | 2013-08-01 13:55:42 -0700 | [diff] [blame] | 164 | PerValue = hist->Percentile(0.50, data); |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 165 | |
| 166 | std::string text; |
| 167 | std::stringstream stream; |
Mathieu Chartier | 3e669db | 2013-11-20 15:51:12 -0800 | [diff] [blame] | 168 | std::string expected("Reset:\tSum: 2.654ms 99% C.I. 15us-212us Avg: 126.380us Max: 212us\n"); |
Mathieu Chartier | e5426c9 | 2013-08-01 13:55:42 -0700 | [diff] [blame] | 169 | hist->PrintConfidenceIntervals(stream, 0.99, data); |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 170 | |
| 171 | EXPECT_EQ(expected, stream.str()); |
| 172 | EXPECT_GE(PerValue, 132); |
| 173 | EXPECT_LE(PerValue, 145); |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 174 | } |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 175 | |
| 176 | TEST(Histtest, MultipleCreateHist) { |
Ian Rogers | 700a402 | 2014-05-19 16:49:03 -0700 | [diff] [blame] | 177 | std::unique_ptr<Histogram<uint64_t>> hist(new Histogram<uint64_t>("MultipleCreateHist", 5)); |
Mathieu Chartier | e5426c9 | 2013-08-01 13:55:42 -0700 | [diff] [blame] | 178 | Histogram<uint64_t>::CumulativeData data; |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 179 | |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 180 | double PerValue; |
| 181 | hist->AddValue(15); |
| 182 | hist->AddValue(17); |
| 183 | hist->AddValue(35); |
| 184 | hist->AddValue(50); |
| 185 | hist->AddValue(68); |
| 186 | hist->AddValue(75); |
| 187 | hist->AddValue(93); |
Ian Rogers | 500793f | 2013-11-14 17:49:12 -0800 | [diff] [blame] | 188 | hist->CreateHistogram(&data); |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 189 | hist->AddValue(110); |
| 190 | hist->AddValue(121); |
| 191 | hist->AddValue(132); |
Brian Carlstrom | 7934ac2 | 2013-07-26 10:54:15 -0700 | [diff] [blame] | 192 | hist->AddValue(140); // Median value |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 193 | hist->AddValue(145); |
| 194 | hist->AddValue(155); |
| 195 | hist->AddValue(163); |
| 196 | hist->AddValue(168); |
Ian Rogers | 500793f | 2013-11-14 17:49:12 -0800 | [diff] [blame] | 197 | hist->CreateHistogram(&data); |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 198 | hist->AddValue(175); |
| 199 | hist->AddValue(182); |
| 200 | hist->AddValue(193); |
| 201 | hist->AddValue(200); |
| 202 | hist->AddValue(205); |
| 203 | hist->AddValue(212); |
Ian Rogers | 500793f | 2013-11-14 17:49:12 -0800 | [diff] [blame] | 204 | hist->CreateHistogram(&data); |
Mathieu Chartier | e5426c9 | 2013-08-01 13:55:42 -0700 | [diff] [blame] | 205 | PerValue = hist->Percentile(0.50, data); |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 206 | std::stringstream stream; |
Mathieu Chartier | 3e669db | 2013-11-20 15:51:12 -0800 | [diff] [blame] | 207 | std::string expected("MultipleCreateHist:\tSum: 2.654ms 99% C.I. 15us-212us Avg: 126.380us Max: 212us\n"); |
Mathieu Chartier | e5426c9 | 2013-08-01 13:55:42 -0700 | [diff] [blame] | 208 | hist->PrintConfidenceIntervals(stream, 0.99, data); |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 209 | |
| 210 | EXPECT_EQ(expected, stream.str()); |
| 211 | EXPECT_GE(PerValue, 132); |
| 212 | EXPECT_LE(PerValue, 145); |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 213 | } |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 214 | |
| 215 | TEST(Histtest, SingleValue) { |
Ian Rogers | 700a402 | 2014-05-19 16:49:03 -0700 | [diff] [blame] | 216 | std::unique_ptr<Histogram<uint64_t>> hist(new Histogram<uint64_t>("SingleValue", 5)); |
Mathieu Chartier | e5426c9 | 2013-08-01 13:55:42 -0700 | [diff] [blame] | 217 | Histogram<uint64_t>::CumulativeData data; |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 218 | |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 219 | hist->AddValue(1); |
Ian Rogers | 500793f | 2013-11-14 17:49:12 -0800 | [diff] [blame] | 220 | hist->CreateHistogram(&data); |
Sameer Abu Asal | c081e36 | 2013-02-20 16:45:38 -0800 | [diff] [blame] | 221 | std::stringstream stream; |
Mathieu Chartier | 3e669db | 2013-11-20 15:51:12 -0800 | [diff] [blame] | 222 | std::string expected = "SingleValue:\tSum: 1us 99% C.I. 1us-1us Avg: 1us Max: 1us\n"; |
Mathieu Chartier | e5426c9 | 2013-08-01 13:55:42 -0700 | [diff] [blame] | 223 | hist->PrintConfidenceIntervals(stream, 0.99, data); |
Sameer Abu Asal | 857a078 | 2013-02-21 11:00:20 -0800 | [diff] [blame] | 224 | EXPECT_EQ(expected, stream.str()); |
Sameer Abu Asal | 857a078 | 2013-02-21 11:00:20 -0800 | [diff] [blame] | 225 | } |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 226 | |
Sameer Abu Asal | 857a078 | 2013-02-21 11:00:20 -0800 | [diff] [blame] | 227 | TEST(Histtest, CappingPercentiles) { |
Ian Rogers | 700a402 | 2014-05-19 16:49:03 -0700 | [diff] [blame] | 228 | std::unique_ptr<Histogram<uint64_t>> hist(new Histogram<uint64_t>("CappingPercentiles", 5)); |
Mathieu Chartier | e5426c9 | 2013-08-01 13:55:42 -0700 | [diff] [blame] | 229 | Histogram<uint64_t>::CumulativeData data; |
Sameer Abu Asal | 857a078 | 2013-02-21 11:00:20 -0800 | [diff] [blame] | 230 | |
| 231 | double per_995; |
| 232 | double per_005; |
Sameer Abu Asal | 857a078 | 2013-02-21 11:00:20 -0800 | [diff] [blame] | 233 | // All values are similar. |
| 234 | for (uint64_t idx = 0ull; idx < 150ull; idx++) { |
| 235 | hist->AddValue(0); |
| 236 | } |
Ian Rogers | 500793f | 2013-11-14 17:49:12 -0800 | [diff] [blame] | 237 | hist->CreateHistogram(&data); |
Mathieu Chartier | e5426c9 | 2013-08-01 13:55:42 -0700 | [diff] [blame] | 238 | per_995 = hist->Percentile(0.995, data); |
Ian Rogers | 647b1a8 | 2014-10-10 11:02:11 -0700 | [diff] [blame] | 239 | EXPECT_DOUBLE_EQ(per_995, 0.0); |
Sameer Abu Asal | 857a078 | 2013-02-21 11:00:20 -0800 | [diff] [blame] | 240 | hist->Reset(); |
| 241 | for (size_t idx = 0; idx < 200; idx++) { |
| 242 | for (uint64_t val = 1ull; val <= 4ull; val++) { |
| 243 | hist->AddValue(val); |
| 244 | } |
| 245 | } |
Ian Rogers | 500793f | 2013-11-14 17:49:12 -0800 | [diff] [blame] | 246 | hist->CreateHistogram(&data); |
Mathieu Chartier | e5426c9 | 2013-08-01 13:55:42 -0700 | [diff] [blame] | 247 | per_005 = hist->Percentile(0.005, data); |
| 248 | per_995 = hist->Percentile(0.995, data); |
Ian Rogers | 647b1a8 | 2014-10-10 11:02:11 -0700 | [diff] [blame] | 249 | EXPECT_DOUBLE_EQ(1.0, per_005); |
| 250 | EXPECT_DOUBLE_EQ(4.0, per_995); |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 251 | } |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 252 | |
| 253 | TEST(Histtest, SpikyValues) { |
Ian Rogers | 700a402 | 2014-05-19 16:49:03 -0700 | [diff] [blame] | 254 | std::unique_ptr<Histogram<uint64_t>> hist(new Histogram<uint64_t>("SpikyValues", 5, 4096)); |
Mathieu Chartier | e5426c9 | 2013-08-01 13:55:42 -0700 | [diff] [blame] | 255 | Histogram<uint64_t>::CumulativeData data; |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 256 | |
Sameer Abu Asal | c081e36 | 2013-02-20 16:45:38 -0800 | [diff] [blame] | 257 | for (uint64_t idx = 0ull; idx < 30ull; idx++) { |
| 258 | for (uint64_t idx_inner = 0ull; idx_inner < 5ull; idx_inner++) { |
| 259 | hist->AddValue(idx * idx_inner); |
| 260 | } |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 261 | } |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 262 | hist->AddValue(10000); |
Ian Rogers | 500793f | 2013-11-14 17:49:12 -0800 | [diff] [blame] | 263 | hist->CreateHistogram(&data); |
Sameer Abu Asal | c081e36 | 2013-02-20 16:45:38 -0800 | [diff] [blame] | 264 | std::stringstream stream; |
Mathieu Chartier | 3e669db | 2013-11-20 15:51:12 -0800 | [diff] [blame] | 265 | std::string expected = "SpikyValues:\tSum: 14.350ms 99% C.I. 0.089us-2541.825us Avg: 95.033us Max: 10000us\n"; |
Mathieu Chartier | e5426c9 | 2013-08-01 13:55:42 -0700 | [diff] [blame] | 266 | hist->PrintConfidenceIntervals(stream, 0.99, data); |
Sameer Abu Asal | 857a078 | 2013-02-21 11:00:20 -0800 | [diff] [blame] | 267 | EXPECT_EQ(expected, stream.str()); |
Sameer Abu Asal | a843954 | 2013-02-14 16:06:42 -0800 | [diff] [blame] | 268 | } |
Brian Carlstrom | 3e3d591 | 2013-07-18 00:19:45 -0700 | [diff] [blame] | 269 | |
Brian Carlstrom | 7934ac2 | 2013-07-26 10:54:15 -0700 | [diff] [blame] | 270 | } // namespace art |