Search in sources :

Example 1 with CommandCount

use of com.alibaba.cobar.statistic.CommandCount in project cobar by alibaba.

the class ShowCommand method getRow.

private static RowDataPacket getRow(NIOProcessor processor, String charset) {
    CommandCount cc = processor.getCommands();
    RowDataPacket row = new RowDataPacket(FIELD_COUNT);
    row.add(processor.getName().getBytes());
    row.add(LongUtil.toBytes(cc.initDBCount()));
    row.add(LongUtil.toBytes(cc.queryCount()));
    row.add(LongUtil.toBytes(cc.stmtPrepareCount()));
    row.add(LongUtil.toBytes(cc.stmtExecuteCount()));
    row.add(LongUtil.toBytes(cc.stmtCloseCount()));
    row.add(LongUtil.toBytes(cc.pingCount()));
    row.add(LongUtil.toBytes(cc.killCount()));
    row.add(LongUtil.toBytes(cc.quitCount()));
    row.add(LongUtil.toBytes(cc.otherCount()));
    return row;
}
Also used : RowDataPacket(com.alibaba.cobar.net.mysql.RowDataPacket) CommandCount(com.alibaba.cobar.statistic.CommandCount)

Aggregations

RowDataPacket (com.alibaba.cobar.net.mysql.RowDataPacket)1 CommandCount (com.alibaba.cobar.statistic.CommandCount)1