|
@@ -12,7 +12,7 @@ swapunit::~swapunit()
|
|
|
|
|
|
}
|
|
|
|
|
|
-int swapunit::sendmsg(std::string strobjid, std::shared_ptr<char> pdata_ptr, int ndatasize,double fpingavg)
|
|
|
+int swapunit::sendmsg(std::string strobjid, std::shared_ptr<char> pdata_ptr, int ndatasize,double fpingavg,double flatency_nodestore)
|
|
|
{
|
|
|
if(mbrun == false)
|
|
|
{
|
|
@@ -28,6 +28,7 @@ int swapunit::sendmsg(std::string strobjid, std::shared_ptr<char> pdata_ptr, int
|
|
|
xmsg.nRecvTime = std::chrono::system_clock::now().time_since_epoch().count();
|
|
|
xmsg.pdata_ptr = pdata_ptr;
|
|
|
xmsg.pingavg = fpingavg;
|
|
|
+ xmsg.flatency_nodestore = flatency_nodestore;
|
|
|
|
|
|
|
|
|
if(mvectorsendmsgbuf.size()>30000)
|
|
@@ -82,6 +83,7 @@ void swapunit::threadsend(::grpc::ServerReaderWriter<iv::CloudSwapReplyStream, i
|
|
|
iv::CloudSwapReplyStream xreply;
|
|
|
xreply.set_nres(xvectorsendmsgbuf.size());
|
|
|
double fpinginobj;
|
|
|
+ double flatencyinnodestore = 0.0;
|
|
|
if(xvectorsendmsgbuf.size() == 0)
|
|
|
{
|
|
|
xreply.set_flatency_inserver(0.0);
|
|
@@ -94,12 +96,15 @@ void swapunit::threadsend(::grpc::ServerReaderWriter<iv::CloudSwapReplyStream, i
|
|
|
flatinserver = flatinserver/1000000.0; //ms
|
|
|
xreply.set_flatency_inserver(flatinserver);
|
|
|
fpinginobj = xvectorsendmsgbuf[0].pingavg;
|
|
|
+ flatencyinnodestore = xvectorsendmsgbuf[0].flatency_nodestore;
|
|
|
+
|
|
|
}
|
|
|
for(i=0;i<nsize;i++)
|
|
|
{
|
|
|
std::cout<<" add reply data. "<<std::endl;
|
|
|
xreply.add_xdata(xvectorsendmsgbuf[i].pdata_ptr.get(),xvectorsendmsgbuf[i].ndatasize);
|
|
|
}
|
|
|
+ xreply.set_flatencyinstore_obj(flatencyinnodestore);
|
|
|
xreply.set_flatency_innode(mfpingavg);
|
|
|
xreply.set_flatency_inobjnode(fpinginobj);
|
|
|
xreply.set_nmsgservertime(xNow);
|