本文整理汇总了C++中TimeStat::getTime方法的典型用法代码示例。如果您正苦于以下问题:C++ TimeStat::getTime方法的具体用法?C++ TimeStat::getTime怎么用?C++ TimeStat::getTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimeStat
的用法示例。
在下文中一共展示了TimeStat::getTime方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get
BlockInfoPtr DataNodeManager::get(BlockDBKey key, bool write) {
TimeStat t;
IceUtil::Mutex::Lock lock(_blockMutexs[key%MUTEX_COUNT]);
if(key == 0) {
return 0;
}
BlockData blkOld;
BlockInfoPtr blkInfo;
bool suc = _hashDB.get(key, blkOld);
if(!suc) {
if(!write) {
PerformanceStat::instance().stat("get", t.getTime());
return 0;
} else {
BlockData newBlk;
if(allocFreeBlock(key, newBlk)) {
blkInfo = BlockDataToBlockInfo(newBlk);
blkInfo->userId = key;
_hashDB.put(key, newBlk);
MCE_INFO("DataNodeManager::get --> new blk node:" << blkInfo->serverId << " u:" << blkInfo->userId
<< " tc:" << blkInfo->totalCount << " cc:" << blkInfo->curCount
<< " f:" << blkInfo->fileId << " b:" << blkInfo->blockIndex
<< " preF:" << blkInfo->preFileId << " preB:" << blkInfo->preBlockIndex);
PerformanceStat::instance().stat("get", t.getTime());
return blkInfo;
}
}
} else if(!write) {
blkInfo = BlockDataToBlockInfo(blkOld);
blkInfo->userId = key;
PerformanceStat::instance().stat("get", t.getTime());
return blkInfo;
} else if(blkOld.curCount < RECORD_COUNT_PER_BLOCK) {
blkOld.curCount++;
blkOld.totalCount++;
blkInfo = BlockDataToBlockInfo(blkOld);
blkInfo->userId = key;
_hashDB.put(key, blkOld);
PerformanceStat::instance().stat("get", t.getTime());
return blkInfo;
} else {
BlockData newBlk;
if(allocFreeBlockInNode(newBlk, blkOld.serverId)) {
newBlk.totalCount = blkOld.totalCount + 1;
blkInfo = BlockDataToBlockInfo(newBlk);
blkInfo->userId = key;
blkInfo->preFileId = blkOld.fileId;
blkInfo->preBlockIndex = blkOld.blockIndex;
_hashDB.put(key, newBlk);
MCE_INFO("DataNodeManager::get --> new blk node:" << blkInfo->serverId << " u:" << blkInfo->userId
<< " tc:" << blkInfo->totalCount << " cc:" << blkInfo->curCount
<< " f:" << blkInfo->fileId << " b:" << blkInfo->blockIndex
<< " preF:" << blkInfo->preFileId << " preB:" << blkInfo->preBlockIndex);
PerformanceStat::instance().stat("get", t.getTime());
return blkInfo;
}
MCE_WARN("allocFreeBlock err");
}
return 0;
}
示例2: getFeedIndex
FeedIndexPtr DbHelper::getFeedIndex(Ice::Long feed) {
TimeStat ts;
Statement sql;
sql << "SELECT * FROM " << getIndexTab(feed) << " WHERE " << COL_FEED
<< " = " << feed;
mysqlpp::StoreQueryResult res = QueryRunner(DB_INSTANCE, CDbRServer,
getIndexTab(feed)).store(sql);
if (!res) {
MCE_WARN("DbHelper::getFeedIndex --> query db fail ");
return 0;
}
if(res.empty()){
MCE_INFO("DbHelper::getFeedIndex --> res is empty");
return 0;
}
FeedIndexPtr index = new FeedIndex;
for (size_t i = 0; i < res.num_rows(); ++i) {
mysqlpp::Row& row = res.at(i);
index->feed = row[COL_FEED];
index->newsMerge = row[COL_NEWS_MERGE];
index->miniMerge = row[COL_MINI_MERGE];
index->source = row[COL_SOURCE];
index->psource = row[COL_PSOURCE];
index->stype = row[COL_SMALLTYPE];
index->ptype = row[COL_PTYPE];
index->actor = row[COL_ACTOR];
index->time = (time_t) mysqlpp::DateTime(row[COL_TIME]);
}
MCE_INFO("DbHelper::getFeedIndex --> cost:" << ts.getTime());
return index;
}
示例3: GetFocusSource
void DispatchTask::GetFocusSource(const FeedSeedPtr & seed,map<int,int> & rank){
vector<int> sources;
int actor = seed->actor;
int stype = seed->type & 0xFFFF;
long fid = seed->feed;
int oldsz = rank.size();
TimeStat ts;
try{
sources = FeedFocusInvertReplicaAdapter::instance().GetSources(actor);
//sources = FeedFocusInvertAdapter::instance().GetSources(actor);
} catch (Ice::Exception& e) {
MCE_WARN("DispatchTask::GetFocusSource. actor:" << actor << " fid:" << fid << " stype:" << stype << " error: "<< e);
return;
}catch(...){
MCE_WARN("DispatchTask::GetFocusSource. actor:" << actor << " fid:" << fid << " stype:" << stype << " unknown error" );
return;
}
BOOST_FOREACH(int source,sources){
rank[source] = 100;
}
MCE_INFO("DispatchTask::GetFocusSource. actor:" << actor << " fid:" << fid << " stype:" << stype
<< " sources:" << sources.size() << " oldrank:" << oldsz << " newranksize:" << rank.size()
<< " cost:" << ts.getTime()
);
}
示例4: putBatch
void FeedDBDataI::putBatch(const FeedItem& feed, const BlockInfoSeq& blkInfoSeq, const Ice::Current&){
if(!_inited){
MCE_WARN("FeedDBDataI::putBatch --> not initialized");
return;
}
//MCE_INFO("@@@@@@");
//MCE_INFO("FeedDBDataI::putBatch --> to size:" << blkInfoSeq.size());
TimeStat t;
map<int, FeedItemBlockInfoSeq> split;
for(int i=0; i<blkInfoSeq.size(); i++){
if(blkInfoSeq.at(i)->serverId != _index){
MCE_WARN("FeedDBDataI::putBatch --> serverid err " << _index << " " << blkInfoSeq.at(i)->serverId);
continue;
}
FeedItemBlockInfoPtr data = new FeedItemBlockInfo;
data->blk = blkInfoSeq.at(i);
data->item = feed;
data->item.weight = blkInfoSeq.at(i)->weight;
split[blkInfoSeq.at(i)->fileId].push_back(data);
}
map<int, FeedItemBlockInfoSeq>::iterator it = split.begin();
for(; it!=split.end(); ++it){
if(it->second.empty()){
MCE_WARN("FeedDBDataI::putBatch --> empty fileid:" << it->first);
}
CacheManager::instance().asyncPut(it->second, true, 0);
}
PerformanceStat::instance().stat("putBatch", t.getTime());
}
示例5: RemoveRoomMember
void MucTalkRoomManagerI::RemoveRoomMember(int userid, const MucRoomIdPtr& roomid, const Ice::Current& current){
TimeStat ts;
RoomPoolPtr pool = GetPool(roomid);
if(pool){
pool->RemoveRoomMember(userid, roomid);
}
MCE_INFO("interface RemoveRoomMember usetime : " << ts.getTime());
}
示例6: CreateRoom
void MucTalkRoomManagerI::CreateRoom(const MucRoomIdPtr& roomid, const Ice::Current& current){
TimeStat ts;
RoomPoolPtr pool = GetPool(roomid);
if(pool){
pool->CreateRoom(roomid);
}
MCE_INFO("interface CreateRoom usetime : " << ts.getTime());
}
示例7: SendPrivateMsg
void MucOnlineManagerI::SendPrivateMsg(const JidPtr& sender, const MucUserIdentityPtr& recidentity, const string& msg, const Ice::Current& current) {
TimeStat ts;
RoomPoolPtr pool = GetPool(recidentity->roomid);
if(pool) {
pool->SendPrivateMsg(sender, recidentity, msg);
}
MCE_INFO("interface SendPrivateMsg usetime : " << ts.getTime());
}
示例8: SetPermision
void MucOnlineManagerI::SetPermision(int opuser, Permisions permision, int targetuser, const MucRoomIdPtr& roomid, const Ice::Current& current) {
TimeStat ts;
RoomPoolPtr pool = GetPool(roomid);
if(pool) {
pool->SetPermision(opuser, permision, targetuser, roomid);
}
MCE_INFO("interface SetPermision usetime : " << ts.getTime());
}
示例9: ChatSetingChange
void MucOnlineManagerI::ChatSetingChange(int userid, const MucRoomIdPtr& roomid, int set, const Ice::Current& current) {
TimeStat ts;
RoomPoolPtr pool = GetPool(roomid);
if(pool) {
pool->ChatSetingChange(userid, roomid, set);
}
MCE_INFO("interface ChatSetingChange usetime : " << ts.getTime());
}
示例10: UserOnline
void MucOnlineManagerI::UserOnline(const MucActiveUserPtr& activeuser, const Ice::Current& current) {
TimeStat ts;
RoomPoolPtr pool = GetPool(activeuser->identity->roomid);
if(pool) {
pool->UserOnline(activeuser);
}
MCE_INFO("interface UserOnline usetime : " << ts.getTime());
}
示例11: AwayRoom
void MucOnlineManagerI::AwayRoom(const JidPtr& opuser, const MucRoomIdPtr& roomid, const Ice::Current& current) {
TimeStat ts;
RoomPoolPtr pool = GetPool(roomid);
if(pool) {
pool->AwayRoom(opuser, roomid);
}
MCE_INFO("interface AwayRoom usetime : " << ts.getTime());
}
示例12: SendTalkMessage
void MucOnlineManagerI::SendTalkMessage(const JidPtr& opuser, const MucRoomIdPtr& roomid, const string& msg, const Ice::Current& current) {
TimeStat ts;
RoomPoolPtr pool = GetPool(roomid);
if(pool) {
pool->SendTalkMessage(opuser, roomid, msg);
}
MCE_INFO("interface SendTalkMessage usetime : " << ts.getTime());
}
示例13: QuitChat
void DispatchNManagerI::QuitChat(::Ice::Int uid, const GroupIndexSeq& groups,
const ::Ice::Current&) {
TimeStat ts;
if (!enable_chat_) {
MCE_INFO("DispatchNManagerI::QuitChat chat is already disabled,uid:"<< uid);
return;
}
UgcChatController::instance().QuitChat(uid, groups);
FunStatManager::instance().Stat("DispatchNManagerI::QuitChat", ts.getTime(), false);
}
示例14: GetRoomMember
IntSeq MucTalkRoomManagerI::GetRoomMember(const MucRoomIdPtr& roomid , const Ice::Current& current){
TimeStat ts;
IntSeq ans;
RoomPoolPtr pool = GetPool(roomid);
if(pool){
ans = pool->GetRoomMember(roomid);
}
MCE_INFO("interface GetRoomMember usetime : " << ts.getTime());
return ans;
}
示例15: SetPermisionForIM
bool MucOnlineManagerI::SetPermisionForIM(int opuser, Permisions permision, int targetuser, const MucRoomIdPtr& roomid, const Ice::Current& current) {
TimeStat ts;
bool ans = false;
RoomPoolPtr pool = GetPool(roomid);
if(pool) {
ans = pool->SetPermisionForIM(opuser, permision, targetuser, roomid);
}
MCE_INFO("interface SetPermisionForIM usetime : " << ts.getTime());
return ans;
}