empiredan commented on code in PR #1374:
URL: 
https://github.com/apache/incubator-pegasus/pull/1374#discussion_r1127302260


##########
src/server/pegasus_server_impl.cpp:
##########
@@ -277,21 +334,20 @@ void pegasus_server_impl::on_get(get_rpc rpc)
         return;
     }
 
+    METRIC_VAR_AUTO_LATENCY(get_latency_ns);
+
+    const auto &key = rpc.request();
     rocksdb::Slice skey(key.data(), key.length());
     std::string value;
     rocksdb::Status status = _db->Get(_data_cf_rd_opts, _data_cf, skey, 
&value);
 
     if (status.ok()) {
         if (check_if_record_expired(utils::epoch_now(), value)) {
-            _pfc_recent_expire_count->increment();
-            if (_verbose_log) {
-                LOG_ERROR_PREFIX("rocksdb data expired for get from {}", 
rpc.remote_address());
-            }
+            METRIC_VAR_INCREMENT(read_expired_values);
+            log_expired_data_if_verbose(__FUNCTION__, rpc.remote_address(), 
key);

Review Comment:
   OK, I'll make it more graceful with macro.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to