| 320 | } |
| 321 | |
| 322 | void RuntimeProfile::InitFromThrift(const TRuntimeProfileNode& node, ObjectPool* pool) { |
| 323 | // Only read 'counters' for non-aggregated profiles. Aggregated profiles will populate |
| 324 | // 'counter_map_' from the aggregated counters in thrift. |
| 325 | for (int i = 0; i < node.counters.size(); ++i) { |
| 326 | const TCounter& counter = node.counters[i]; |
| 327 | counter_map_[counter.name] = pool->Add(new Counter(counter.unit, counter.value)); |
| 328 | } |
| 329 | |
| 330 | if (node.__isset.event_sequences) { |
| 331 | for (const TEventSequence& sequence: node.event_sequences) { |
| 332 | event_sequence_map_[sequence.name] = |
| 333 | pool->Add(new EventSequence(sequence.timestamps, sequence.labels)); |
| 334 | } |
| 335 | } |
| 336 | |
| 337 | if (node.__isset.time_series_counters) { |
| 338 | for (const TTimeSeriesCounter& val: node.time_series_counters) { |
| 339 | // Capture all incoming time series counters with the same type since re-sampling |
| 340 | // will have happened on the sender side. |
| 341 | time_series_counter_map_[val.name] = pool->Add( |
| 342 | new ChunkedTimeSeriesCounter(val.name, val.unit, val.period_ms, val.values)); |
| 343 | } |
| 344 | } |
| 345 | |
| 346 | if (node.__isset.summary_stats_counters) { |
| 347 | for (const TSummaryStatsCounter& val: node.summary_stats_counters) { |
| 348 | summary_stats_map_[val.name] = pool->Add(new SummaryStatsCounter( |
| 349 | val.unit, val.total_num_values, val.min_value, val.max_value, val.sum)); |
| 350 | } |
| 351 | } |
| 352 | } |
| 353 | |
| 354 | void AggregatedRuntimeProfile::UpdateAggregatedFromInstance( |
| 355 | RuntimeProfile* other, int idx, bool add_default_counters) { |
no test coverage detected