当前位置: 首页>>代码示例>>C++>>正文


C++ TimeStat类代码示例

本文整理汇总了C++中TimeStat的典型用法代码示例。如果您正苦于以下问题:C++ TimeStat类的具体用法?C++ TimeStat怎么用?C++ TimeStat使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了TimeStat类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: MCE_WARN

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());
}
开发者ID:bradenwu,项目名称:oce,代码行数:29,代码来源:FeedDBDataI.cpp

示例2: fids

pair<float,float> FeedItemManagerI::GetFeedContentDict(GetRequest & req,FeedContentDict & fdict){
  set<long> & fidset = req.GetShowedFids();;
  vector<long> fids(fidset.begin(),fidset.end());

  TimeStat ts;
	try {
    fdict = FeedContentAdapter::instance().getFeedDict(fids);
  } catch (Ice::Exception& e) {
    MCE_WARN("FeedItemManagerI::GetFeedContentDict. get memcached fail. uid:" << req.uid_ << " err:" << e);
  }
  int memcnt = fdict.size();
  float memcost = ts.Get();

  bool load_db = false;
  if(fdict.size() < fids.size()){
    CheckLoad(req.uid_,fids,fdict);
    load_db = true;
  }
  int dbcnt = fdict.size() - memcnt;
  float dbcost = ts.Get();

  MCE_INFO("FeedItemManagerI::GetFeedContentDict. uid:" << req.uid_
  		<< " request:" << fids.size()
  		<< " load_db:" << load_db
  		<< " memcnt:" << memcnt << " dbcnt:" << dbcnt
  		<< " total:" << fdict.size()
  		<< " memcost:" << memcost << " dbcost:" << dbcost
  );
  return make_pair(memcost,dbcost);
//  MCE_INFO("show fids:" << PrintHelper::Print(fids));
//  if(fids.size() > 100){
//  	MCE_WARN("@@@@@@@@@@ TOOLARGE. uid:" << req.uid_);
//  	PrintHelper::Print(req.item3d_);
//  }
}
开发者ID:bradenwu,项目名称:oce,代码行数:35,代码来源:FeedItemI.cpp

示例3: 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;
}
开发者ID:gunner14,项目名称:old_rr_code,代码行数:31,代码来源:DbHelper.cpp

示例4: 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()
	);
}
开发者ID:bradenwu,项目名称:oce,代码行数:25,代码来源:FeedDispatcher.cpp

示例5: 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());
}
开发者ID:bradenwu,项目名称:oce,代码行数:8,代码来源:MucTalkRoomManagerI.cpp

示例6: 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());
}
开发者ID:bradenwu,项目名称:oce,代码行数:8,代码来源:MucTalkRoomManagerI.cpp

示例7: 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());
}
开发者ID:goby,项目名称:oce,代码行数:8,代码来源:MucOnlineManagerI.cpp

示例8: 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());
}
开发者ID:goby,项目名称:oce,代码行数:8,代码来源:MucOnlineManagerI.cpp

示例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());
}
开发者ID:goby,项目名称:oce,代码行数:8,代码来源:MucOnlineManagerI.cpp

示例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());
}
开发者ID:goby,项目名称:oce,代码行数:8,代码来源:MucOnlineManagerI.cpp

示例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());
}
开发者ID:goby,项目名称:oce,代码行数:8,代码来源:MucOnlineManagerI.cpp

示例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());
}
开发者ID:goby,项目名称:oce,代码行数:8,代码来源:MucOnlineManagerI.cpp

示例13: 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;
}
开发者ID:bradenwu,项目名称:oce,代码行数:10,代码来源:MucTalkRoomManagerI.cpp

示例14: GetActiveJids

JidSeq MucOnlineManagerI::GetActiveJids(const MucRoomIdPtr& roomid, const Ice::Current&) {
    TimeStat ts;
    JidSeq ans;
    RoomPoolPtr pool = GetPool(roomid);
    if(pool) {
        ans = pool->GetActiveJids(roomid);
    }
    MCE_INFO("interface GetActiveJids usetime : " << ts.getTime());
    return ans;
}
开发者ID:goby,项目名称:oce,代码行数:10,代码来源:MucOnlineManagerI.cpp

示例15: 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);
}
开发者ID:gunner14,项目名称:old_rr_code,代码行数:10,代码来源:DispatchNI.cpp


注:本文中的TimeStat类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。