@Test public void noExtraTags() throws Exception { InfluxMetric converted = InfluxMetricConverter.convertToInfluxMetric("foo", 1, EMPTY_TAG_LIST, 2l); InfluxMetric expected = new InfluxMetric("foo", EMPTY_TAG_LIST, 1, 2l); assertThat(converted, equalTo(expected)); }
@Test public void tagsInMetricName() throws Exception { InfluxMetric converted = InfluxMetricConverter.convertToInfluxMetric("foo,tag1=tagValue1", 1, EMPTY_TAG_LIST, 2l); InfluxMetric expected = new InfluxMetric("foo", Arrays.asList(new InfluxTag("tag1", "tagValue1")), 1, 2l); assertThat(converted, equalTo(expected)); }
@Test public void additionalTags() throws Exception { InfluxMetric converted = InfluxMetricConverter.convertToInfluxMetric( "foo,tag1=tagValue1", 1, Arrays.asList(new InfluxTag("additionalTag", "value")), 2l); InfluxMetric expected = new InfluxMetric( "foo", Arrays.asList( new InfluxTag("additionalTag", "value"), new InfluxTag("tag1", "tagValue1")), 1, 2l); assertThat(converted, equalTo(expected)); }