本文整理汇总了Java中com.alibaba.cobar.manager.dataobject.cobarnode.CommandStatus.getQuery方法的典型用法代码示例。如果您正苦于以下问题:Java CommandStatus.getQuery方法的具体用法?Java CommandStatus.getQuery怎么用?Java CommandStatus.getQuery使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.alibaba.cobar.manager.dataobject.cobarnode.CommandStatus
的用法示例。
在下文中一共展示了CommandStatus.getQuery方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: statistic
import com.alibaba.cobar.manager.dataobject.cobarnode.CommandStatus; //导入方法依赖的package包/类
public void statistic() {
initDBNum = 0;
queryNum = 0;
stmtPrepareNum = 0;
stmtExcuteNum = 0;
stmtClosed = 0;
pingNum = 0;
killNum = 0;
quitNum = 0;
otherNum = 0;
commandList = cobarAdapter.listCommandStatus();
for (CommandStatus command : commandList) {
initDBNum += command.getInitDB();
queryNum += command.getQuery();
stmtPrepareNum += command.getStmtPrepared();
stmtExcuteNum += command.getStmtExecute();
stmtClosed += command.getStmtClose();
pingNum += command.getPing();
killNum += command.getKill();
quitNum += command.getQuit();
otherNum += command.getOther();
}
}
示例2: groupByCList
import com.alibaba.cobar.manager.dataobject.cobarnode.CommandStatus; //导入方法依赖的package包/类
private long groupByCList(List<CommandStatus> list, int type) {
long result = 0;
switch (type) {
case REQUEST_COUNT:
for (CommandStatus p : list) {
result += p.getQuery();
}
break;
default:
throw new IllegalArgumentException("invalid parameter");
}
return result;
}
示例3: groupByCList
import com.alibaba.cobar.manager.dataobject.cobarnode.CommandStatus; //导入方法依赖的package包/类
private long groupByCList(List<CommandStatus> list, int type) {
long result = 0;
switch (type) {
case REQUEST_COUNT:
for (CommandStatus p : list) {
result += p.getQuery();
}
break;
default:
throw new IllegalArgumentException("invalid parameter");
}
return result;
}