[Server] Support reporting flush time in psp
commitc31889ea2c56ea0e3a334a9a6f3daa661c133f0c
authorqigao <gao@facebook.com>
Sat, 20 Nov 2010 01:05:48 +0000 (19 17:05 -0800)
committermacvicar <macvicar@facebook.com>
Tue, 23 Nov 2010 17:35:43 +0000 (23 09:35 -0800)
tree17f3287f189c1a46b535fa0c17c4e154a29724c1
parent7c1e13d42a2cb56ed2270f1c87770484a9341039
[Server] Support reporting flush time in psp

Summary:
Adding support to get initial total response size from libevent
and measure the time for initial flushing. Keep the data in transport
and add an extension call to allow php to get the data in psp phase.

Test Plan:
make fast_tests
<?php
function psp_func() {
  $stats = fb_get_flush_stat();
  error_log('Total bytes in response: ' . $stats['total']);
  error_log('Sent: ' . $stats['sent']);
  error_log('Time in us: '. $stats['time']);
}
function test() {
  register_postsend_function('psp_func');
  echo "register done";
  echo "send send";
}
test();

DiffCamp Revision: 185194
Reviewed By: hzhao
CC: ps, hzhao, macvicar, qigao, hphp-diffs@lists
Tasks:
#440068: export http flush times in hphp

Revert Plan:
OK
src/idl/fb.idl.php
src/runtime/base/server/libevent_server.cpp
src/runtime/base/server/libevent_server.h
src/runtime/base/server/libevent_transport.cpp
src/runtime/base/server/transport.cpp
src/runtime/base/server/transport.h
src/runtime/ext/ext_fb.cpp
src/runtime/ext/ext_fb.h
src/runtime/ext/profile/extprofile_fb.h
src/system/fb.inc
src/system/gen/sys/dynamic_table_func.no.cpp