Search in sources :

Example 6 with DummyCharacterFilter

use of org.apache.flink.runtime.metrics.util.DummyCharacterFilter in project flink by apache.

the class MetricGroupTest method testCreateQueryServiceMetricInfo.

@Test
public void testCreateQueryServiceMetricInfo() {
    JobID jid = new JobID();
    AbstractID vid = new AbstractID();
    AbstractID eid = new AbstractID();
    MetricRegistry registry = new MetricRegistry(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);
}
Also used : QueryScopeInfo(org.apache.flink.runtime.metrics.dump.QueryScopeInfo) MetricRegistry(org.apache.flink.runtime.metrics.MetricRegistry) DummyCharacterFilter(org.apache.flink.runtime.metrics.util.DummyCharacterFilter) AbstractID(org.apache.flink.util.AbstractID) JobID(org.apache.flink.api.common.JobID) Test(org.junit.Test)

Example 7 with DummyCharacterFilter

use of org.apache.flink.runtime.metrics.util.DummyCharacterFilter in project flink by apache.

the class OperatorGroupTest method testCreateQueryServiceMetricInfo.

@Test
public void testCreateQueryServiceMetricInfo() {
    JobID jid = new JobID();
    AbstractID vid = new AbstractID();
    AbstractID eid = new AbstractID();
    MetricRegistry registry = new MetricRegistry(MetricRegistryConfiguration.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);
    OperatorMetricGroup operator = new OperatorMetricGroup(registry, task, "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);
}
Also used : QueryScopeInfo(org.apache.flink.runtime.metrics.dump.QueryScopeInfo) MetricRegistry(org.apache.flink.runtime.metrics.MetricRegistry) DummyCharacterFilter(org.apache.flink.runtime.metrics.util.DummyCharacterFilter) AbstractID(org.apache.flink.util.AbstractID) JobID(org.apache.flink.api.common.JobID) Test(org.junit.Test)

Aggregations

MetricRegistry (org.apache.flink.runtime.metrics.MetricRegistry)7 QueryScopeInfo (org.apache.flink.runtime.metrics.dump.QueryScopeInfo)7 DummyCharacterFilter (org.apache.flink.runtime.metrics.util.DummyCharacterFilter)7 Test (org.junit.Test)7 JobID (org.apache.flink.api.common.JobID)5 AbstractID (org.apache.flink.util.AbstractID)3