use of net.opentsdb.utils.Pair in project opentsdb by OpenTSDB.
the class TestTags method parseWithMetricListNullTagk2.
@Test
public void parseWithMetricListNullTagk2() {
final List<Pair<String, String>> tags = new ArrayList<Pair<String, String>>(2);
final String metric = Tags.parseWithMetric("sys.cpu.user{host=web01,=lga}", tags);
assertEquals("sys.cpu.user", metric);
assertEquals(2, tags.size());
assertEquals("host", tags.get(0).getKey());
assertEquals("web01", tags.get(0).getValue());
assertNull(tags.get(1).getKey());
assertEquals("lga", tags.get(1).getValue());
}
use of net.opentsdb.utils.Pair in project opentsdb by OpenTSDB.
the class TestTags method parseWithMetricListNullTagk.
@Test
public void parseWithMetricListNullTagk() {
final List<Pair<String, String>> tags = new ArrayList<Pair<String, String>>(1);
final String metric = Tags.parseWithMetric("sys.cpu.user{=web01}", tags);
assertEquals("sys.cpu.user", metric);
assertEquals(1, tags.size());
assertNull(tags.get(0).getKey());
assertEquals("web01", tags.get(0).getValue());
}
use of net.opentsdb.utils.Pair in project opentsdb by OpenTSDB.
the class TestTags method parseWithMetricListNullTagv2.
@Test
public void parseWithMetricListNullTagv2() {
final List<Pair<String, String>> tags = new ArrayList<Pair<String, String>>(2);
final String metric = Tags.parseWithMetric("sys.cpu.user{host=web01,dc=}", tags);
assertEquals("sys.cpu.user", metric);
assertEquals(2, tags.size());
assertEquals("host", tags.get(0).getKey());
assertEquals("web01", tags.get(0).getValue());
assertEquals("dc", tags.get(1).getKey());
assertNull(tags.get(1).getValue());
}
Aggregations