Skip to content

expand spectator testing example to show checking tags #25

@brharrington

Description

@brharrington

Something like:

  void doSometing(Registry r) {
    Timer t = r.timer("panama.test.metric", "a", "1", "b", "2");
    t.record(42, TimeUnit.NANOSECONDS);
  }

  @Test
  public void checkTags() {
    Registry r = new DefaultRegistry();
    doSometing(r);

    r.timers()
        .filter(t -> "panama.test.metric".equals(t.id().name()))
        .forEach(t -> {
          Id id = t.id();
          Assert.assertEquals("1", Utils.getTagValue(id, "a"));
          Assert.assertEquals("2", Utils.getTagValue(id, "b"));
        });
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions