Search in sources :

Example 1 with CountersSnapshotDTO

use of org.apache.nifi.web.api.dto.CountersSnapshotDTO in project nifi by apache.

the class StandardNiFiServiceFacade method getCounters.

@Override
public CountersDTO getCounters() {
    final List<Counter> counters = controllerFacade.getCounters();
    final Set<CounterDTO> counterDTOs = new LinkedHashSet<>(counters.size());
    for (final Counter counter : counters) {
        counterDTOs.add(dtoFactory.createCounterDto(counter));
    }
    final CountersSnapshotDTO snapshotDto = dtoFactory.createCountersDto(counterDTOs);
    final CountersDTO countersDto = new CountersDTO();
    countersDto.setAggregateSnapshot(snapshotDto);
    return countersDto;
}
Also used : LinkedHashSet(java.util.LinkedHashSet) CounterDTO(org.apache.nifi.web.api.dto.CounterDTO) Counter(org.apache.nifi.controller.Counter) CountersDTO(org.apache.nifi.web.api.dto.CountersDTO) CountersSnapshotDTO(org.apache.nifi.web.api.dto.CountersSnapshotDTO)

Aggregations

LinkedHashSet (java.util.LinkedHashSet)1 Counter (org.apache.nifi.controller.Counter)1 CounterDTO (org.apache.nifi.web.api.dto.CounterDTO)1 CountersDTO (org.apache.nifi.web.api.dto.CountersDTO)1 CountersSnapshotDTO (org.apache.nifi.web.api.dto.CountersSnapshotDTO)1