| 529 | } |
| 530 | |
| 531 | void AssertPrometheus(const std::stringstream& val, const string& name, |
| 532 | const string& value, const string& desc, const string& kind = "") { |
| 533 | std::stringstream exp_val; |
| 534 | // convert to all values to expected format |
| 535 | exp_val << "# HELP " << name << " " << desc << "\n" |
| 536 | << "# TYPE " << name << " " << kind << "\n"; |
| 537 | if (name == "impala_stats_metric" || name == "impala_histogram_metric") { |
| 538 | exp_val << value + "\n"; |
| 539 | } else { |
| 540 | exp_val << name << " " << value + "\n"; |
| 541 | } |
| 542 | EXPECT_EQ(val.str(), exp_val.str()); |
| 543 | } |
| 544 | |
| 545 | TEST_F(MetricsTest, CountersPrometheus) { |
| 546 | MetricGroup metrics("CounterMetrics"); |