You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
559 B

  1. # Copyright (c) 2018 Tildes contributors <code@tildes.net>
  2. # SPDX-License-Identifier: AGPL-3.0-or-later
  3. from tildes.metrics import _COUNTERS, _HISTOGRAMS
  4. def test_all_metric_names_prefixed():
  5. """Ensure all metric names have the 'tildes_' prefix."""
  6. for metric_dict in (_COUNTERS, _HISTOGRAMS):
  7. metrics = metric_dict.values()
  8. for metric in metrics:
  9. # this is ugly, but seems to be the "generic" way to get the name
  10. metric_name = metric.describe()[0].name
  11. assert metric_name.startswith("tildes_")