@@ -4078,8 +4078,19 @@ void FileStore::processReceiptEvent(unsigned int primaryLeaseId,
40784078 }
40794079 if (++(from->second .d_count ) >= d_replicationFactor) {
40804080 from->second .d_handle ->second .d_hasReceipt = true ;
4081- // notify the queue
40824081
4082+ // Calculate time it took for the message to be stored and
4083+ // replicated.
4084+ const bsls::Types::Int64 timeDelta =
4085+ bmqsys::Time::highResolutionTimer () -
4086+ from->second .d_handle ->second .d_arrivalTimepoint ;
4087+ d_clusterStats_p->onPartitionEvent (
4088+ mqbstat::ClusterStats::PartitionEventType::
4089+ e_PARTITION_REPLICATION,
4090+ d_config.partitionId (),
4091+ timeDelta);
4092+
4093+ // notify the queue
40834094 const mqbu::StorageKey& queueKey = from->second .d_queueKey ;
40844095 bool haveQueue = (queueKey == lastKey);
40854096 if (!haveQueue) {
@@ -4089,16 +4100,12 @@ void FileStore::processReceiptEvent(unsigned int primaryLeaseId,
40894100 lastKey = queueKey;
40904101 lastQueue = sit->second ->queue ();
40914102 BSLS_ASSERT_SAFE (lastQueue);
4092-
40934103 affectedQueues.insert (lastQueue);
40944104 }
40954105 // else the queue and its storage are gone; ignore the receipt
40964106 }
40974107 if (haveQueue) {
4098- lastQueue->onReceipt (
4099- from->second .d_guid ,
4100- from->second .d_qH ,
4101- from->second .d_handle ->second .d_arrivalTimepoint );
4108+ lastQueue->onReceipt (from->second .d_guid , from->second .d_qH );
41024109 } // else the queue is gone
41034110 from = d_unreceipted.erase (from);
41044111 }
@@ -7276,8 +7283,19 @@ void FileStore::setReplicationFactor(int value)
72767283 while (it != d_unreceipted.end ()) {
72777284 if (it->second .d_count >= d_replicationFactor) {
72787285 it->second .d_handle ->second .d_hasReceipt = true ;
7279- // notify the queue.
72807286
7287+ // Calculate time it took for the message to be stored and
7288+ // replicated.
7289+ const bsls::Types::Int64 timeDelta =
7290+ bmqsys::Time::highResolutionTimer () -
7291+ it->second .d_handle ->second .d_arrivalTimepoint ;
7292+ d_clusterStats_p->onPartitionEvent (
7293+ mqbstat::ClusterStats::PartitionEventType::
7294+ e_PARTITION_REPLICATION,
7295+ d_config.partitionId (),
7296+ timeDelta);
7297+
7298+ // notify the queue.
72817299 const mqbu::StorageKey& queueKey = it->second .d_queueKey ;
72827300 bool haveQueue = (queueKey == lastKey);
72837301 if (!haveQueue) {
@@ -7287,16 +7305,12 @@ void FileStore::setReplicationFactor(int value)
72877305 lastKey = queueKey;
72887306 lastQueue = sit->second ->queue ();
72897307 BSLS_ASSERT_SAFE (lastQueue);
7290-
72917308 affectedQueues.insert (lastQueue);
72927309 }
72937310 // else the queue and its storage are gone; ignore the receipt
72947311 }
72957312 if (haveQueue) {
7296- lastQueue->onReceipt (
7297- it->second .d_guid ,
7298- it->second .d_qH ,
7299- it->second .d_handle ->second .d_arrivalTimepoint );
7313+ lastQueue->onReceipt (it->second .d_guid , it->second .d_qH );
73007314 } // else the queue is gone
73017315 it = d_unreceipted.erase (it);
73027316 }
0 commit comments