class StreamStatusMonitor implements AgentStatusMonitor {

    @Override
    public AgentStatus getStatus(String agentInstanceId) {
        AgentStatus agentStatus = instanceStatuses.get(agentInstanceId);
        if (agentStatus == null) {
            if (failOnMissingData) {
                throw AgentManagementException.agentNotFound(agentInstanceId);
            }
            AgentInstance agentInstance = agentManagementService.getAgentInstance(agentInstanceId);
            return AgentStatus.healthy(source, agentInstance, "No data recorded yet; assuming healthy", scheduler.now());
        }
        return agentStatus;
    }

    public  StreamStatusMonitor(String source,
                               boolean failOnMissingData,
                               AgentManagementService agentManagementService,
                               Observable<AgentStatus> agentStatusObservable,
                               Registry registry,
                               Scheduler scheduler);

}