@Test public void queueStatisticsConvertWorks() { QueueStatistics queuedStatistics = new QueueStatistics(2, 42l, 10l); QueueStatistics executionStatistics = new QueueStatistics(5, null, null); Statistics stats = new Statistics(queuedStatistics, executionStatistics); StatisticsResponse response = converter.convert(stats); io.nflow.rest.v1.msg.QueueStatistics restQueueStats = response.queueStatistics; assertThat(restQueueStats.count, is(2)); assertThat(restQueueStats.maxAge, is(42l)); assertThat(restQueueStats.minAge, is(10l)); io.nflow.rest.v1.msg.QueueStatistics restExecStats = response.executionStatistics; assertThat(restExecStats.count, is(5)); assertThat(restExecStats.maxAge, nullValue()); assertThat(restExecStats.minAge, nullValue()); }
public StatisticsResponse convert(Statistics stats) { StatisticsResponse response = new StatisticsResponse(); response.queueStatistics.count = stats.queuedStatistics.count; response.queueStatistics.maxAge = stats.queuedStatistics.maxAgeMillis; response.queueStatistics.minAge = stats.queuedStatistics.minAgeMillis; response.executionStatistics.count = stats.executionStatistics.count; response.executionStatistics.maxAge = stats.executionStatistics.maxAgeMillis; response.executionStatistics.minAge = stats.executionStatistics.minAgeMillis; return response; }
StatisticsConverter { public StatisticsResponse convert(Statistics stats) { StatisticsResponse response = new StatisticsResponse(); response.queueStatistics.count = stats.queuedStatistics.count; response.queueStatistics.maxAge = stats.queuedStatistics.maxAgeMillis; response.queueStatistics.minAge = stats.queuedStatistics.minAgeMillis; response.executionStatistics.count = stats.executionStatistics.count; response.executionStatistics.maxAge = stats.executionStatistics.maxAgeMillis; response.executionStatistics.minAge = stats.executionStatistics.minAgeMillis; return response; } }
StatisticsConverter { public StatisticsResponse convert(Statistics stats) { StatisticsResponse response = new StatisticsResponse(); response.queueStatistics.count = stats.queuedStatistics.count; response.queueStatistics.maxAge = stats.queuedStatistics.maxAgeMillis; response.queueStatistics.minAge = stats.queuedStatistics.minAgeMillis; response.executionStatistics.count = stats.executionStatistics.count; response.executionStatistics.maxAge = stats.executionStatistics.maxAgeMillis; response.executionStatistics.minAge = stats.executionStatistics.minAgeMillis; return response; }  }
StatisticsConverter { public StatisticsResponse convert(Statistics stats) { StatisticsResponse response = new StatisticsResponse(); response.queueStatistics.count = stats.queuedStatistics.count; response.queueStatistics.maxAge = stats.queuedStatistics.maxAgeMillis; response.queueStatistics.minAge = stats.queuedStatistics.minAgeMillis; response.executionStatistics.count = stats.executionStatistics.count; response.executionStatistics.maxAge = stats.executionStatistics.maxAgeMillis; response.executionStatistics.minAge = stats.executionStatistics.minAgeMillis; return response; }  StatisticsResponse convert(Statistics stats); WorkflowDefinitionStatisticsResponse convert(Map<String, Map<String, WorkflowDefinitionStatistics>> stats); }
StatisticsConverter { public StatisticsResponse convert(Statistics stats) { StatisticsResponse response = new StatisticsResponse(); response.queueStatistics.count = stats.queuedStatistics.count; response.queueStatistics.maxAge = stats.queuedStatistics.maxAgeMillis; response.queueStatistics.minAge = stats.queuedStatistics.minAgeMillis; response.executionStatistics.count = stats.executionStatistics.count; response.executionStatistics.maxAge = stats.executionStatistics.maxAgeMillis; response.executionStatistics.minAge = stats.executionStatistics.minAgeMillis; return response; }  StatisticsResponse convert(Statistics stats); WorkflowDefinitionStatisticsResponse convert(Map<String, Map<String, WorkflowDefinitionStatistics>> stats);  }