Search in sources :

Example 1 with MonitorService

use of org.elasticsearch.monitor.MonitorService in project crate by crate.

the class NodeStatsContextFieldResolverTest method setup.

@Before
public void setup() throws UnknownHostException {
    final OsService osService = mock(OsService.class);
    final OsStats osStats = mock(OsStats.class);
    final MonitorService monitorService = mock(MonitorService.class);
    when(monitorService.osService()).thenReturn(osService);
    when(osService.stats()).thenReturn(osStats);
    DiscoveryNode discoveryNode = newNode("node_name", "node_id");
    postgresAddress = new TransportAddress(Inet4Address.getLocalHost(), 5432);
    resolver = new NodeStatsContextFieldResolver(() -> discoveryNode, monitorService, () -> null, () -> new HttpStats(20L, 30L), mock(ThreadPool.class), new ExtendedNodeInfo(), () -> new ConnectionStats(2L, 4L), () -> postgresAddress, () -> 12L, () -> 1L);
}
Also used : OsService(org.elasticsearch.monitor.os.OsService) DiscoveryNode(org.elasticsearch.cluster.node.DiscoveryNode) MonitorService(org.elasticsearch.monitor.MonitorService) TransportAddress(org.elasticsearch.common.transport.TransportAddress) HttpStats(org.elasticsearch.http.HttpStats) ExtendedNodeInfo(io.crate.monitor.ExtendedNodeInfo) ConnectionStats(io.crate.protocols.ConnectionStats) OsStats(org.elasticsearch.monitor.os.OsStats) Before(org.junit.Before)

Aggregations

ExtendedNodeInfo (io.crate.monitor.ExtendedNodeInfo)1 ConnectionStats (io.crate.protocols.ConnectionStats)1 DiscoveryNode (org.elasticsearch.cluster.node.DiscoveryNode)1 TransportAddress (org.elasticsearch.common.transport.TransportAddress)1 HttpStats (org.elasticsearch.http.HttpStats)1 MonitorService (org.elasticsearch.monitor.MonitorService)1 OsService (org.elasticsearch.monitor.os.OsService)1 OsStats (org.elasticsearch.monitor.os.OsStats)1 Before (org.junit.Before)1