org.apache.flink.runtime.metrics.util.DummyCharacterFilter Java Examples
The following examples show how to use
org.apache.flink.runtime.metrics.util.DummyCharacterFilter.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MetricGroupTest.java From flink with Apache License 2.0 | 6 votes |
/** * Verifies that existing key/value groups are returned when calling {@link MetricGroup#addGroup(String)}. */ @Test public void testNameCollisionAfterKeyValueGroup() { MetricRegistry registry = NoOpMetricRegistry.INSTANCE; GenericMetricGroup root = new GenericMetricGroup(registry, new DummyAbstractMetricGroup(registry), "root"); String key = "key"; String value = "value"; root.addGroup(key, value); MetricGroup group = root.addGroup(key).addGroup(value); String variableValue = group.getAllVariables().get(ScopeFormat.asVariable("key")); assertEquals(value, variableValue); String identifier = group.getMetricIdentifier("metric"); assertTrue("Key is missing from metric identifier.", identifier.contains("key")); assertTrue("Value is missing from metric identifier.", identifier.contains("value")); String logicalScope = ((AbstractMetricGroup) group).getLogicalScope(new DummyCharacterFilter()); assertTrue("Key is missing from logical scope.", logicalScope.contains(key)); assertFalse("Value is present in logical scope.", logicalScope.contains(value)); }
Example #2
Source File: OperatorGroupTest.java From flink with Apache License 2.0 | 6 votes |
@Test public void testCreateQueryServiceMetricInfo() { JobID jid = new JobID(); JobVertexID vid = new JobVertexID(); AbstractID eid = new AbstractID(); OperatorID oid = new OperatorID(); TaskManagerMetricGroup tm = new TaskManagerMetricGroup(registry, "host", "id"); TaskManagerJobMetricGroup job = new TaskManagerJobMetricGroup(registry, tm, jid, "jobname"); TaskMetricGroup task = new TaskMetricGroup(registry, job, vid, eid, "taskName", 4, 5); OperatorMetricGroup operator = new OperatorMetricGroup(registry, task, oid, "operator"); QueryScopeInfo.OperatorQueryScopeInfo info = operator.createQueryServiceMetricInfo(new DummyCharacterFilter()); assertEquals("", info.scope); assertEquals(jid.toString(), info.jobID); assertEquals(vid.toString(), info.vertexID); assertEquals(4, info.subtaskIndex); assertEquals("operator", info.operatorName); }
Example #3
Source File: MetricGroupTest.java From flink with Apache License 2.0 | 6 votes |
@Test public void testCreateQueryServiceMetricInfo() { JobID jid = new JobID(); JobVertexID vid = new JobVertexID(); AbstractID eid = new AbstractID(); MetricRegistryImpl registry = new MetricRegistryImpl(defaultMetricRegistryConfiguration); TaskManagerMetricGroup tm = new TaskManagerMetricGroup(registry, "host", "id"); TaskManagerJobMetricGroup job = new TaskManagerJobMetricGroup(registry, tm, jid, "jobname"); TaskMetricGroup task = new TaskMetricGroup(registry, job, vid, eid, "taskName", 4, 5); GenericMetricGroup userGroup1 = new GenericMetricGroup(registry, task, "hello"); GenericMetricGroup userGroup2 = new GenericMetricGroup(registry, userGroup1, "world"); QueryScopeInfo.TaskQueryScopeInfo info1 = (QueryScopeInfo.TaskQueryScopeInfo) userGroup1.createQueryServiceMetricInfo(new DummyCharacterFilter()); assertEquals("hello", info1.scope); assertEquals(jid.toString(), info1.jobID); assertEquals(vid.toString(), info1.vertexID); assertEquals(4, info1.subtaskIndex); QueryScopeInfo.TaskQueryScopeInfo info2 = (QueryScopeInfo.TaskQueryScopeInfo) userGroup2.createQueryServiceMetricInfo(new DummyCharacterFilter()); assertEquals("hello.world", info2.scope); assertEquals(jid.toString(), info2.jobID); assertEquals(vid.toString(), info2.vertexID); assertEquals(4, info2.subtaskIndex); }
Example #4
Source File: MetricGroupTest.java From flink with Apache License 2.0 | 6 votes |
/** * Verifies that calling {@link AbstractMetricGroup#getLogicalScope(CharacterFilter, char, int)} on {@link GenericValueMetricGroup} * should ignore value as well. */ @Test public void testLogicalScopeShouldIgnoreValueGroupName() throws Exception { Configuration config = new Configuration(); config.setString(ConfigConstants.METRICS_REPORTER_PREFIX + "test." + ConfigConstants.METRICS_REPORTER_CLASS_SUFFIX, TestReporter.class.getName()); MetricRegistryImpl registry = new MetricRegistryImpl(MetricRegistryConfiguration.fromConfiguration(config)); try { GenericMetricGroup root = new GenericMetricGroup(registry, new DummyAbstractMetricGroup(registry), "root"); String key = "key"; String value = "value"; MetricGroup group = root.addGroup(key, value); String logicalScope = ((AbstractMetricGroup) group) .getLogicalScope(new DummyCharacterFilter(), registry.getDelimiter(), 0); assertThat("Key is missing from logical scope.", logicalScope, containsString(key)); assertThat("Value is present in logical scope.", logicalScope, not(containsString(value))); } finally { registry.shutdown().get(); } }
Example #5
Source File: MetricGroupTest.java From flink with Apache License 2.0 | 6 votes |
/** * Verifies that existing key/value groups are returned when calling {@link MetricGroup#addGroup(String)}. */ @Test public void testNameCollisionAfterKeyValueGroup() { MetricRegistry registry = NoOpMetricRegistry.INSTANCE; GenericMetricGroup root = new GenericMetricGroup(registry, new DummyAbstractMetricGroup(registry), "root"); String key = "key"; String value = "value"; root.addGroup(key, value); MetricGroup group = root.addGroup(key).addGroup(value); String variableValue = group.getAllVariables().get(ScopeFormat.asVariable("key")); assertEquals(value, variableValue); String identifier = group.getMetricIdentifier("metric"); assertTrue("Key is missing from metric identifier.", identifier.contains("key")); assertTrue("Value is missing from metric identifier.", identifier.contains("value")); String logicalScope = ((AbstractMetricGroup) group).getLogicalScope(new DummyCharacterFilter()); assertTrue("Key is missing from logical scope.", logicalScope.contains(key)); assertFalse("Value is present in logical scope.", logicalScope.contains(value)); }
Example #6
Source File: MetricGroupTest.java From flink with Apache License 2.0 | 6 votes |
/** * Verifies that calling {@link MetricGroup#addGroup(String, String)} if a generic group with the key and value name * already exists goes through the generic code path. */ @Test public void testNameCollisionForKeyAndValueAfterGenericGroup() { MetricRegistry registry = NoOpMetricRegistry.INSTANCE; GenericMetricGroup root = new GenericMetricGroup(registry, new DummyAbstractMetricGroup(registry), "root"); String key = "key"; String value = "value"; root.addGroup(key).addGroup(value); MetricGroup group = root.addGroup(key, value); String variableValue = group.getAllVariables().get(ScopeFormat.asVariable("key")); assertNull(variableValue); String identifier = group.getMetricIdentifier("metric"); assertTrue("Key is missing from metric identifier.", identifier.contains("key")); assertTrue("Value is missing from metric identifier.", identifier.contains("value")); String logicalScope = ((AbstractMetricGroup) group).getLogicalScope(new DummyCharacterFilter()); assertTrue("Key is missing from logical scope.", logicalScope.contains(key)); assertTrue("Value is missing from logical scope.", logicalScope.contains(value)); }
Example #7
Source File: MetricGroupTest.java From flink with Apache License 2.0 | 6 votes |
/** * Verifies that calling {@link MetricGroup#addGroup(String, String)} if a generic group with the key name already * exists goes through the generic code path. */ @Test public void testNameCollisionForKeyAfterGenericGroup() { MetricRegistry registry = NoOpMetricRegistry.INSTANCE; GenericMetricGroup root = new GenericMetricGroup(registry, new DummyAbstractMetricGroup(registry), "root"); String key = "key"; String value = "value"; root.addGroup(key); MetricGroup group = root.addGroup(key, value); String variableValue = group.getAllVariables().get(ScopeFormat.asVariable("key")); assertNull(variableValue); String identifier = group.getMetricIdentifier("metric"); assertTrue("Key is missing from metric identifier.", identifier.contains("key")); assertTrue("Value is missing from metric identifier.", identifier.contains("value")); String logicalScope = ((AbstractMetricGroup) group).getLogicalScope(new DummyCharacterFilter()); assertTrue("Key is missing from logical scope.", logicalScope.contains(key)); assertTrue("Value is missing from logical scope.", logicalScope.contains(value)); }
Example #8
Source File: MetricGroupTest.java From flink with Apache License 2.0 | 6 votes |
/** * Verifies the basic behavior when defining user-defined variables. */ @Test public void testUserDefinedVariable() { MetricRegistry registry = NoOpMetricRegistry.INSTANCE; GenericMetricGroup root = new GenericMetricGroup(registry, new DummyAbstractMetricGroup(registry), "root"); String key = "key"; String value = "value"; MetricGroup group = root.addGroup(key, value); String variableValue = group.getAllVariables().get(ScopeFormat.asVariable("key")); assertEquals(value, variableValue); String identifier = group.getMetricIdentifier("metric"); assertTrue("Key is missing from metric identifier.", identifier.contains("key")); assertTrue("Value is missing from metric identifier.", identifier.contains("value")); String logicalScope = ((AbstractMetricGroup) group).getLogicalScope(new DummyCharacterFilter()); assertTrue("Key is missing from logical scope.", logicalScope.contains(key)); assertFalse("Value is present in logical scope.", logicalScope.contains(value)); }
Example #9
Source File: OperatorGroupTest.java From flink with Apache License 2.0 | 6 votes |
@Test public void testCreateQueryServiceMetricInfo() { JobID jid = new JobID(); JobVertexID vid = new JobVertexID(); AbstractID eid = new AbstractID(); OperatorID oid = new OperatorID(); TaskManagerMetricGroup tm = new TaskManagerMetricGroup(registry, "host", "id"); TaskManagerJobMetricGroup job = new TaskManagerJobMetricGroup(registry, tm, jid, "jobname"); TaskMetricGroup task = new TaskMetricGroup(registry, job, vid, eid, "taskName", 4, 5); OperatorMetricGroup operator = new OperatorMetricGroup(registry, task, oid, "operator"); QueryScopeInfo.OperatorQueryScopeInfo info = operator.createQueryServiceMetricInfo(new DummyCharacterFilter()); assertEquals("", info.scope); assertEquals(jid.toString(), info.jobID); assertEquals(vid.toString(), info.vertexID); assertEquals(4, info.subtaskIndex); assertEquals("operator", info.operatorName); }
Example #10
Source File: MetricGroupTest.java From flink with Apache License 2.0 | 6 votes |
@Test public void testCreateQueryServiceMetricInfo() { JobID jid = new JobID(); JobVertexID vid = new JobVertexID(); AbstractID eid = new AbstractID(); MetricRegistryImpl registry = new MetricRegistryImpl(defaultMetricRegistryConfiguration); TaskManagerMetricGroup tm = new TaskManagerMetricGroup(registry, "host", "id"); TaskManagerJobMetricGroup job = new TaskManagerJobMetricGroup(registry, tm, jid, "jobname"); TaskMetricGroup task = new TaskMetricGroup(registry, job, vid, eid, "taskName", 4, 5); GenericMetricGroup userGroup1 = new GenericMetricGroup(registry, task, "hello"); GenericMetricGroup userGroup2 = new GenericMetricGroup(registry, userGroup1, "world"); QueryScopeInfo.TaskQueryScopeInfo info1 = (QueryScopeInfo.TaskQueryScopeInfo) userGroup1.createQueryServiceMetricInfo(new DummyCharacterFilter()); assertEquals("hello", info1.scope); assertEquals(jid.toString(), info1.jobID); assertEquals(vid.toString(), info1.vertexID); assertEquals(4, info1.subtaskIndex); QueryScopeInfo.TaskQueryScopeInfo info2 = (QueryScopeInfo.TaskQueryScopeInfo) userGroup2.createQueryServiceMetricInfo(new DummyCharacterFilter()); assertEquals("hello.world", info2.scope); assertEquals(jid.toString(), info2.jobID); assertEquals(vid.toString(), info2.vertexID); assertEquals(4, info2.subtaskIndex); }
Example #11
Source File: MetricGroupTest.java From flink with Apache License 2.0 | 6 votes |
/** * Verifies that calling {@link AbstractMetricGroup#getLogicalScope(CharacterFilter, char, int)} on {@link GenericValueMetricGroup} * should ignore value as well. */ @Test public void testLogicalScopeShouldIgnoreValueGroupName() throws Exception { Configuration config = new Configuration(); config.setString(ConfigConstants.METRICS_REPORTER_PREFIX + "test." + ConfigConstants.METRICS_REPORTER_CLASS_SUFFIX, TestReporter.class.getName()); MetricRegistryImpl registry = new MetricRegistryImpl(MetricRegistryConfiguration.fromConfiguration(config)); try { GenericMetricGroup root = new GenericMetricGroup(registry, new DummyAbstractMetricGroup(registry), "root"); String key = "key"; String value = "value"; MetricGroup group = root.addGroup(key, value); String logicalScope = ((AbstractMetricGroup) group) .getLogicalScope(new DummyCharacterFilter(), registry.getDelimiter(), 0); assertThat("Key is missing from logical scope.", logicalScope, containsString(key)); assertThat("Value is present in logical scope.", logicalScope, not(containsString(value))); } finally { registry.shutdown().get(); } }
Example #12
Source File: MetricGroupTest.java From flink with Apache License 2.0 | 6 votes |
/** * Verifies that calling {@link MetricGroup#addGroup(String, String)} if a generic group with the key and value name * already exists goes through the generic code path. */ @Test public void testNameCollisionForKeyAndValueAfterGenericGroup() { MetricRegistry registry = NoOpMetricRegistry.INSTANCE; GenericMetricGroup root = new GenericMetricGroup(registry, new DummyAbstractMetricGroup(registry), "root"); String key = "key"; String value = "value"; root.addGroup(key).addGroup(value); MetricGroup group = root.addGroup(key, value); String variableValue = group.getAllVariables().get(ScopeFormat.asVariable("key")); assertNull(variableValue); String identifier = group.getMetricIdentifier("metric"); assertTrue("Key is missing from metric identifier.", identifier.contains("key")); assertTrue("Value is missing from metric identifier.", identifier.contains("value")); String logicalScope = ((AbstractMetricGroup) group).getLogicalScope(new DummyCharacterFilter()); assertTrue("Key is missing from logical scope.", logicalScope.contains(key)); assertTrue("Value is missing from logical scope.", logicalScope.contains(value)); }
Example #13
Source File: MetricGroupTest.java From flink with Apache License 2.0 | 6 votes |
/** * Verifies that calling {@link MetricGroup#addGroup(String, String)} if a generic group with the key name already * exists goes through the generic code path. */ @Test public void testNameCollisionForKeyAfterGenericGroup() { MetricRegistry registry = NoOpMetricRegistry.INSTANCE; GenericMetricGroup root = new GenericMetricGroup(registry, new DummyAbstractMetricGroup(registry), "root"); String key = "key"; String value = "value"; root.addGroup(key); MetricGroup group = root.addGroup(key, value); String variableValue = group.getAllVariables().get(ScopeFormat.asVariable("key")); assertNull(variableValue); String identifier = group.getMetricIdentifier("metric"); assertTrue("Key is missing from metric identifier.", identifier.contains("key")); assertTrue("Value is missing from metric identifier.", identifier.contains("value")); String logicalScope = ((AbstractMetricGroup) group).getLogicalScope(new DummyCharacterFilter()); assertTrue("Key is missing from logical scope.", logicalScope.contains(key)); assertTrue("Value is missing from logical scope.", logicalScope.contains(value)); }
Example #14
Source File: MetricGroupTest.java From flink with Apache License 2.0 | 6 votes |
/** * Verifies the basic behavior when defining user-defined variables. */ @Test public void testUserDefinedVariable() { MetricRegistry registry = NoOpMetricRegistry.INSTANCE; GenericMetricGroup root = new GenericMetricGroup(registry, new DummyAbstractMetricGroup(registry), "root"); String key = "key"; String value = "value"; MetricGroup group = root.addGroup(key, value); String variableValue = group.getAllVariables().get(ScopeFormat.asVariable("key")); assertEquals(value, variableValue); String identifier = group.getMetricIdentifier("metric"); assertTrue("Key is missing from metric identifier.", identifier.contains("key")); assertTrue("Value is missing from metric identifier.", identifier.contains("value")); String logicalScope = ((AbstractMetricGroup) group).getLogicalScope(new DummyCharacterFilter()); assertTrue("Key is missing from logical scope.", logicalScope.contains(key)); assertFalse("Value is present in logical scope.", logicalScope.contains(value)); }
Example #15
Source File: OperatorGroupTest.java From Flink-CEPplus with Apache License 2.0 | 6 votes |
@Test public void testCreateQueryServiceMetricInfo() { JobID jid = new JobID(); JobVertexID vid = new JobVertexID(); AbstractID eid = new AbstractID(); OperatorID oid = new OperatorID(); TaskManagerMetricGroup tm = new TaskManagerMetricGroup(registry, "host", "id"); TaskManagerJobMetricGroup job = new TaskManagerJobMetricGroup(registry, tm, jid, "jobname"); TaskMetricGroup task = new TaskMetricGroup(registry, job, vid, eid, "taskName", 4, 5); OperatorMetricGroup operator = new OperatorMetricGroup(registry, task, oid, "operator"); QueryScopeInfo.OperatorQueryScopeInfo info = operator.createQueryServiceMetricInfo(new DummyCharacterFilter()); assertEquals("", info.scope); assertEquals(jid.toString(), info.jobID); assertEquals(vid.toString(), info.vertexID); assertEquals(4, info.subtaskIndex); assertEquals("operator", info.operatorName); }
Example #16
Source File: MetricGroupTest.java From Flink-CEPplus with Apache License 2.0 | 6 votes |
/** * Verifies the basic behavior when defining user-defined variables. */ @Test public void testUserDefinedVariable() { MetricRegistry registry = NoOpMetricRegistry.INSTANCE; GenericMetricGroup root = new GenericMetricGroup(registry, new DummyAbstractMetricGroup(registry), "root"); String key = "key"; String value = "value"; MetricGroup group = root.addGroup(key, value); String variableValue = group.getAllVariables().get(ScopeFormat.asVariable("key")); assertEquals(value, variableValue); String identifier = group.getMetricIdentifier("metric"); assertTrue("Key is missing from metric identifier.", identifier.contains("key")); assertTrue("Value is missing from metric identifier.", identifier.contains("value")); String logicalScope = ((AbstractMetricGroup) group).getLogicalScope(new DummyCharacterFilter()); assertTrue("Key is missing from logical scope.", logicalScope.contains(key)); assertFalse("Value is present in logical scope.", logicalScope.contains(value)); }
Example #17
Source File: MetricGroupTest.java From Flink-CEPplus with Apache License 2.0 | 6 votes |
/** * Verifies that calling {@link MetricGroup#addGroup(String, String)} if a generic group with the key name already * exists goes through the generic code path. */ @Test public void testNameCollisionForKeyAfterGenericGroup() { MetricRegistry registry = NoOpMetricRegistry.INSTANCE; GenericMetricGroup root = new GenericMetricGroup(registry, new DummyAbstractMetricGroup(registry), "root"); String key = "key"; String value = "value"; root.addGroup(key); MetricGroup group = root.addGroup(key, value); String variableValue = group.getAllVariables().get(ScopeFormat.asVariable("key")); assertNull(variableValue); String identifier = group.getMetricIdentifier("metric"); assertTrue("Key is missing from metric identifier.", identifier.contains("key")); assertTrue("Value is missing from metric identifier.", identifier.contains("value")); String logicalScope = ((AbstractMetricGroup) group).getLogicalScope(new DummyCharacterFilter()); assertTrue("Key is missing from logical scope.", logicalScope.contains(key)); assertTrue("Value is missing from logical scope.", logicalScope.contains(value)); }
Example #18
Source File: MetricGroupTest.java From Flink-CEPplus with Apache License 2.0 | 6 votes |
/** * Verifies that calling {@link MetricGroup#addGroup(String, String)} if a generic group with the key and value name * already exists goes through the generic code path. */ @Test public void testNameCollisionForKeyAndValueAfterGenericGroup() { MetricRegistry registry = NoOpMetricRegistry.INSTANCE; GenericMetricGroup root = new GenericMetricGroup(registry, new DummyAbstractMetricGroup(registry), "root"); String key = "key"; String value = "value"; root.addGroup(key).addGroup(value); MetricGroup group = root.addGroup(key, value); String variableValue = group.getAllVariables().get(ScopeFormat.asVariable("key")); assertNull(variableValue); String identifier = group.getMetricIdentifier("metric"); assertTrue("Key is missing from metric identifier.", identifier.contains("key")); assertTrue("Value is missing from metric identifier.", identifier.contains("value")); String logicalScope = ((AbstractMetricGroup) group).getLogicalScope(new DummyCharacterFilter()); assertTrue("Key is missing from logical scope.", logicalScope.contains(key)); assertTrue("Value is missing from logical scope.", logicalScope.contains(value)); }
Example #19
Source File: MetricGroupTest.java From Flink-CEPplus with Apache License 2.0 | 6 votes |
/** * Verifies that existing key/value groups are returned when calling {@link MetricGroup#addGroup(String)}. */ @Test public void testNameCollisionAfterKeyValueGroup() { MetricRegistry registry = NoOpMetricRegistry.INSTANCE; GenericMetricGroup root = new GenericMetricGroup(registry, new DummyAbstractMetricGroup(registry), "root"); String key = "key"; String value = "value"; root.addGroup(key, value); MetricGroup group = root.addGroup(key).addGroup(value); String variableValue = group.getAllVariables().get(ScopeFormat.asVariable("key")); assertEquals(value, variableValue); String identifier = group.getMetricIdentifier("metric"); assertTrue("Key is missing from metric identifier.", identifier.contains("key")); assertTrue("Value is missing from metric identifier.", identifier.contains("value")); String logicalScope = ((AbstractMetricGroup) group).getLogicalScope(new DummyCharacterFilter()); assertTrue("Key is missing from logical scope.", logicalScope.contains(key)); assertFalse("Value is present in logical scope.", logicalScope.contains(value)); }
Example #20
Source File: MetricGroupTest.java From Flink-CEPplus with Apache License 2.0 | 6 votes |
@Test public void testCreateQueryServiceMetricInfo() { JobID jid = new JobID(); JobVertexID vid = new JobVertexID(); AbstractID eid = new AbstractID(); MetricRegistryImpl registry = new MetricRegistryImpl(defaultMetricRegistryConfiguration); TaskManagerMetricGroup tm = new TaskManagerMetricGroup(registry, "host", "id"); TaskManagerJobMetricGroup job = new TaskManagerJobMetricGroup(registry, tm, jid, "jobname"); TaskMetricGroup task = new TaskMetricGroup(registry, job, vid, eid, "taskName", 4, 5); GenericMetricGroup userGroup1 = new GenericMetricGroup(registry, task, "hello"); GenericMetricGroup userGroup2 = new GenericMetricGroup(registry, userGroup1, "world"); QueryScopeInfo.TaskQueryScopeInfo info1 = (QueryScopeInfo.TaskQueryScopeInfo) userGroup1.createQueryServiceMetricInfo(new DummyCharacterFilter()); assertEquals("hello", info1.scope); assertEquals(jid.toString(), info1.jobID); assertEquals(vid.toString(), info1.vertexID); assertEquals(4, info1.subtaskIndex); QueryScopeInfo.TaskQueryScopeInfo info2 = (QueryScopeInfo.TaskQueryScopeInfo) userGroup2.createQueryServiceMetricInfo(new DummyCharacterFilter()); assertEquals("hello.world", info2.scope); assertEquals(jid.toString(), info2.jobID); assertEquals(vid.toString(), info2.vertexID); assertEquals(4, info2.subtaskIndex); }
Example #21
Source File: MetricGroupTest.java From Flink-CEPplus with Apache License 2.0 | 6 votes |
/** * Verifies that calling {@link AbstractMetricGroup#getLogicalScope(CharacterFilter, char, int)} on {@link GenericValueMetricGroup} * should ignore value as well. */ @Test public void testLogicalScopeShouldIgnoreValueGroupName() throws Exception { Configuration config = new Configuration(); config.setString(ConfigConstants.METRICS_REPORTER_PREFIX + "test." + ConfigConstants.METRICS_REPORTER_CLASS_SUFFIX, TestReporter.class.getName()); MetricRegistryImpl registry = new MetricRegistryImpl(MetricRegistryConfiguration.fromConfiguration(config)); try { GenericMetricGroup root = new GenericMetricGroup(registry, new DummyAbstractMetricGroup(registry), "root"); String key = "key"; String value = "value"; MetricGroup group = root.addGroup(key, value); String logicalScope = ((AbstractMetricGroup) group) .getLogicalScope(new DummyCharacterFilter(), registry.getDelimiter(), 0); assertThat("Key is missing from logical scope.", logicalScope, containsString(key)); assertThat("Value is present in logical scope.", logicalScope, not(containsString(value))); } finally { registry.shutdown().get(); } }
Example #22
Source File: JobManagerGroupTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testCreateQueryServiceMetricInfo() { MetricRegistryImpl registry = new MetricRegistryImpl(MetricRegistryConfiguration.defaultMetricRegistryConfiguration()); JobManagerMetricGroup jm = new JobManagerMetricGroup(registry, "host"); QueryScopeInfo.JobManagerQueryScopeInfo info = jm.createQueryServiceMetricInfo(new DummyCharacterFilter()); assertEquals("", info.scope); }
Example #23
Source File: TaskManagerGroupTest.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@Test public void testCreateQueryServiceMetricInfo() { TaskManagerMetricGroup tm = new TaskManagerMetricGroup(registry, "host", "id"); QueryScopeInfo.TaskManagerQueryScopeInfo info = tm.createQueryServiceMetricInfo(new DummyCharacterFilter()); assertEquals("", info.scope); assertEquals("id", info.taskManagerID); }
Example #24
Source File: JobManagerJobGroupTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testCreateQueryServiceMetricInfo() { JobID jid = new JobID(); MetricRegistryImpl registry = new MetricRegistryImpl(MetricRegistryConfiguration.defaultMetricRegistryConfiguration()); JobManagerMetricGroup jm = new JobManagerMetricGroup(registry, "host"); JobManagerJobMetricGroup jmj = new JobManagerJobMetricGroup(registry, jm, jid, "jobname"); QueryScopeInfo.JobQueryScopeInfo info = jmj.createQueryServiceMetricInfo(new DummyCharacterFilter()); assertEquals("", info.scope); assertEquals(jid.toString(), info.jobID); }
Example #25
Source File: TaskManagerJobGroupTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testCreateQueryServiceMetricInfo() { JobID jid = new JobID(); TaskManagerMetricGroup tm = new TaskManagerMetricGroup(registry, "host", "id"); TaskManagerJobMetricGroup job = new TaskManagerJobMetricGroup(registry, tm, jid, "jobname"); QueryScopeInfo.JobQueryScopeInfo info = job.createQueryServiceMetricInfo(new DummyCharacterFilter()); assertEquals("", info.scope); assertEquals(jid.toString(), info.jobID); }
Example #26
Source File: TaskMetricGroupTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testCreateQueryServiceMetricInfo() { JobID jid = new JobID(); JobVertexID vid = new JobVertexID(); AbstractID eid = new AbstractID(); TaskManagerMetricGroup tm = new TaskManagerMetricGroup(registry, "host", "id"); TaskManagerJobMetricGroup job = new TaskManagerJobMetricGroup(registry, tm, jid, "jobname"); TaskMetricGroup task = new TaskMetricGroup(registry, job, vid, eid, "taskName", 4, 5); QueryScopeInfo.TaskQueryScopeInfo info = task.createQueryServiceMetricInfo(new DummyCharacterFilter()); assertEquals("", info.scope); assertEquals(jid.toString(), info.jobID); assertEquals(vid.toString(), info.vertexID); assertEquals(4, info.subtaskIndex); }
Example #27
Source File: MetricGroupTest.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
/** * Verifies that calling {@link MetricGroup#addGroup(String, String)} on a {@link GenericKeyMetricGroup} goes * through the generic code path. */ @Test public void testUserDefinedVariableOnKeyGroup() { MetricRegistry registry = NoOpMetricRegistry.INSTANCE; GenericMetricGroup root = new GenericMetricGroup(registry, new DummyAbstractMetricGroup(registry), "root"); String key1 = "key1"; String value1 = "value1"; root.addGroup(key1, value1); String key2 = "key2"; String value2 = "value2"; MetricGroup group = root.addGroup(key1).addGroup(key2, value2); String variableValue = group.getAllVariables().get("value2"); assertNull(variableValue); String identifier = group.getMetricIdentifier("metric"); assertTrue("Key1 is missing from metric identifier.", identifier.contains("key1")); assertTrue("Key2 is missing from metric identifier.", identifier.contains("key2")); assertTrue("Value2 is missing from metric identifier.", identifier.contains("value2")); String logicalScope = ((AbstractMetricGroup) group).getLogicalScope(new DummyCharacterFilter()); assertTrue("Key1 is missing from logical scope.", logicalScope.contains(key1)); assertTrue("Key2 is missing from logical scope.", logicalScope.contains(key2)); assertTrue("Value2 is missing from logical scope.", logicalScope.contains(value2)); }
Example #28
Source File: MetricGroupTest.java From flink with Apache License 2.0 | 5 votes |
/** * Verifies that calling {@link MetricGroup#addGroup(String, String)} on a {@link GenericKeyMetricGroup} goes * through the generic code path. */ @Test public void testUserDefinedVariableOnKeyGroup() { MetricRegistry registry = NoOpMetricRegistry.INSTANCE; GenericMetricGroup root = new GenericMetricGroup(registry, new DummyAbstractMetricGroup(registry), "root"); String key1 = "key1"; String value1 = "value1"; root.addGroup(key1, value1); String key2 = "key2"; String value2 = "value2"; MetricGroup group = root.addGroup(key1).addGroup(key2, value2); String variableValue = group.getAllVariables().get("value2"); assertNull(variableValue); String identifier = group.getMetricIdentifier("metric"); assertTrue("Key1 is missing from metric identifier.", identifier.contains("key1")); assertTrue("Key2 is missing from metric identifier.", identifier.contains("key2")); assertTrue("Value2 is missing from metric identifier.", identifier.contains("value2")); String logicalScope = ((AbstractMetricGroup) group).getLogicalScope(new DummyCharacterFilter()); assertTrue("Key1 is missing from logical scope.", logicalScope.contains(key1)); assertTrue("Key2 is missing from logical scope.", logicalScope.contains(key2)); assertTrue("Value2 is missing from logical scope.", logicalScope.contains(value2)); }
Example #29
Source File: TaskManagerGroupTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testCreateQueryServiceMetricInfo() { TaskManagerMetricGroup tm = new TaskManagerMetricGroup(registry, "host", "id"); QueryScopeInfo.TaskManagerQueryScopeInfo info = tm.createQueryServiceMetricInfo(new DummyCharacterFilter()); assertEquals("", info.scope); assertEquals("id", info.taskManagerID); }
Example #30
Source File: TaskManagerGroupTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testCreateQueryServiceMetricInfo() { TaskManagerMetricGroup tm = new TaskManagerMetricGroup(registry, "host", "id"); QueryScopeInfo.TaskManagerQueryScopeInfo info = tm.createQueryServiceMetricInfo(new DummyCharacterFilter()); assertEquals("", info.scope); assertEquals("id", info.taskManagerID); }