MCPcopy Create free account
hub / github.com/Tencent/phxsql / ByteFromConnectDestSvr

Method ByteFromConnectDestSvr

phxsqlproxy/io_channel.cpp:274–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272}
273
274void IOChannel::ByteFromConnectDestSvr(uint32_t byte_size) {
275 if (byte_size != 0) {
276 MonitorPluginEntry::GetDefault()->GetMonitorPlugin()->ReceiveByteFromConnectDestSvr(byte_size);
277
278 //mysql client stat
279 if (connect_port_ == config_->GetMysqlPort()) {
280 MonitorPluginEntry::GetDefault()->GetMonitorPlugin()->ReceiveByteFromMysql(byte_size);
281 }
282
283 if (last_read_fd_ != sqlsvr_fd_) {
284 MonitorPluginEntry::GetDefault()->GetMonitorPlugin()->DestSvrRespPacket();
285 last_read_fd_ = sqlsvr_fd_;
286
287 if (last_received_request_timestamp_) {
288 uint64_t cost = GetTimestampMS() - last_received_request_timestamp_;
289 if (connect_port_ == config_->GetMysqlPort()) {
290 //LOG_DEBUG("recieve mysql resp cost %llu", cost);
291 MonitorPluginEntry::GetDefault()->GetMonitorPlugin()->MysqlQueryCost(cost);
292 }
293 //LOG_DEBUG("request exec cost %llu", cost);
294 MonitorPluginEntry::GetDefault()->GetMonitorPlugin()->RequestExecuteCost(cost);
295 }
296 }
297 }
298}
299
300void IOChannel::ByteFromMysqlClient(uint32_t byte_size) {
301 if (byte_size != 0) {

Callers

nothing calls this directly

Calls 8

GetTimestampMSFunction · 0.85
GetMonitorPluginMethod · 0.80
GetMysqlPortMethod · 0.80
ReceiveByteFromMysqlMethod · 0.80
DestSvrRespPacketMethod · 0.80
MysqlQueryCostMethod · 0.80
RequestExecuteCostMethod · 0.80

Tested by

no test coverage detected