Search in sources :

Example 1 with NodeMetrics

use of org.corfudb.format.Types.NodeMetrics in project CorfuDB by CorfuDB.

the class ManagementServer method handleHearbeatRequest.

/**
     * Handles the heartbeat request.
     * It accumulates the metrics required to build
     * and send the response(NodeMetrics).
     *
     * @param msg
     * @param ctx
     * @param r
     */
@ServerHandler(type = CorfuMsgType.HEARTBEAT_REQUEST, opTimer = metricsPrefix + "heartbeat-request")
public void handleHearbeatRequest(CorfuMsg msg, ChannelHandlerContext ctx, IServerRouter r, boolean isMetricsEnabled) {
    // Currently builds a default instance of the model.
    // TODO: Collect metrics from Layout, Sequencer and LogUnit Servers.
    NodeMetrics nodeMetrics = NodeMetrics.getDefaultInstance();
    r.sendResponse(ctx, msg, new CorfuPayloadMsg<>(CorfuMsgType.HEARTBEAT_RESPONSE, nodeMetrics.toByteArray()));
}
Also used : NodeMetrics(org.corfudb.format.Types.NodeMetrics)

Aggregations

NodeMetrics (org.corfudb.format.Types.NodeMetrics)1