1 : hb.page_timing_phone ***ost:t8misc1.ny.7w7.us,env:prod,is_cli:0.
|
protected function writeToSocket(string $message): void
{
if (!is_resource ($this->socket )) {
throw new SocketException ($this->host, $this->port, "Couldn't write to socket");
}
fwrite($this->socket, $message);
}
protected function connect(string $host, int $port, int $timeout, bool $persistent): void
{
$errorNumber = 0;
$errorMessage = '';
Monitoring\Metric\Clients\Connection\UdpSocket->writeToSocket [☄] ...
|
parent::writeToSocket($message);
|
1 : hb.page_timing_phone ***ost:t8misc1.ny.7w7.us,env:prod,is_cli:0.
|
class UdpSocket extends AbstractSocket
{
private const HEADER_SIZE = 8;
protected function writeToSocket(string $message): void
{
parent::writeToSocket($message);
usleep (10 );
}
protected function getUrl(string $host): string
{
return "udp://$host";
Monitoring\Metric\Clients\Connection\InetSocket->sendMessages [☄] ...
|
$this->writeToSocket($packet);
|
1 : ["hb.page_timing_pho ***st:t8misc1.ny.7w7.us,env:prod,is_cli:0"]
|
}
if (! $this->isConnected ()) {
$this->connect ($this->host, $this->port, $this->timeout, $this->isPersistent );
}
foreach ($this->cutIntoMtuSizedPackets ($messages) as $packet) {
$this->writeToSocket($packet);
}
}
private function cutIntoMtuSizedPackets(array $messages): array
{
if ($this->allowFragmentation ()) {
Monitoring\Metric\Clients\Connection\InetSocket->send [☄] ...
|
$this->sendMessages([$message]);
|
1 : hb.page_timing_phone ***host:t8misc1.ny.7w7.us,env:prod,is_cli:0
|
public function send(string $message): void
{
if (empty ($message)) {
return;
}
$this->sendMessages([$message]);
}
public function sendMessages(array $messages): void
{
if (count ($messages) === 0 ) {
return;
Monitoring\Metric\Clients\StatsdClient->send [☄] ...
|
$this->connection->send($message);
|
1 : hb.page_timing_phone.hit
1 : 1
1 : c
1 : {"host":"t8misc1.ny.7w7.us","env":"prod","is_cli":0}
|
foreach ($tags as $tagName => $tagValue) {
$tagArray[] = ($tagName . ':' . $tagValue);
}
$message .= '|#' . implode (',', $tagArray);
}
$this->connection->send($message);
}
private function validateMetricName(string $metric): void
{
if (substr ($metric, -1 ) === '.') {
return;
Monitoring\Metric\Clients\StatsdClient->count [☄] ...
|
$this->send($metric, $value, 'c', $tags);
|
1 : page_timing_phone.hit
1 : 1
1 : {"host":"t8misc1.ny.7w7.us","env":"prod","is_cli":0}
|
$tags['event'] = $event;
$this->count ($this->eventMetric, 1, $tags);
}
public function count(string $metric, float $value, array $tags = []): void
{
$this->send($metric, $value, 'c', $tags);
}
private function send(string $metric, $value, string $type, array $tags = []): void
{
$this->validateMetricName ($metric);
if (!empty ($this->namespace )) {
Monitoring\Metric\Clients\StatsdClient->increment [☄] ...
|
$this->count($metric, $value, $tags);
|
1 : page_timing_phone.hit
1 : 1
1 : {"host":"t8misc1.ny.7w7.us","env":"prod","is_cli":0}
|
$this->namespace = $config['namespace'] ?? '';
$this->eventMetric = $config['event_metric'] ?? self::DEFAULT_EVENT_METRIC;
}
public function increment(string $metric, int $value, array $tags = null ): void
{
$this->count($metric, $value, $tags);
}
public function gauge(string $metric, float $value, array $tags = []): void
{
$this->send ($metric, $value, 'g', $tags);
}
Monitoring\Metric\Handler->send [☄] ...
|
$this->getClient($clientClass)->$method($metric, $value, $tags);
|
1 : increment
1 : page_timing_phone.hit
1 : 1
1 : {"host":"t8misc1.ny.7w7.us","env":"prod","is_cli":0}
|
foreach (self::CLIENTS as $clientClass) {
if ($this->isDegraded ($clientClass)) {
continue;
}
try {
$this->getClient($clientClass)->$method($metric, $value, $tags);
continue;
} catch (ValidateException $e) {
ErrorHandler::sentry ()->captureException ($e);
continue;
} catch (DisabledException $e) {
Monitoring\Metric\Handler::inc [☄] ...
|
static::i()->send('increment', $metric, $value, $tags);
|
1 : page_timing_phone.hit
1 : []
1 : 1
|
$this->config = CC ('metric') ?? [];
$this->global_tags = $this->getGlobalTags ();
}
public static function inc(string $metric, array $tags = [], int $value = 1 ): void
{
static::i()->send('increment', $metric, $value, $tags);
}
public static function gauge(string $metric, float $value, array $tags = []): void
{
static::i ()->send (__FUNCTION__, $metric, $value, $tags);
}
Statistic_iStat->sendMetric [☄] ...
|
\Monitoring\Metric\Metrics::inc($metric, [], $value);
|
1 : {"time":0.0204739570 ***1767578,"hit_02":1,"hit_obot":1,"hit":1}
|
foreach ($metrics as $name => $value) {
$metric = $this->prepareMetricName ($this->name . '.' . $name);
if ($name === 'time') {
\Monitoring\Metric\Metrics::histogram ($metric, $value);
} else {
\Monitoring\Metric\Metrics::inc($metric, [], $value);
}
}
}
private function prepareMetricName(string $metric): string
{
Statistic_iStat_Web_GoApi->hit [☄] ...
|
$this->sendMetric($inc);
|
1 : {"time":0.0204739570 ***1767578,"hit_02":1,"hit_obot":1,"hit":1}
1 : []
|
if (! is_array ($inc))
$inc = [$inc => 1 ];
if (! isset ($inc['hit']))
$inc['hit'] = 1;
$this->save ($inc, $data);
$this->sendMetric($inc);
}
// Compatibility ONLY !! - direct api-socket write
protected function save(array $inc= [], array $data= []) {
Profiler::info ("iStat/api(". $this->name. ")", $inc + ($data ? ['data' => $data] : []));
$this->goApiSave ($inc, $data);
Statistic_iStat_Web_GoApi->apcHit [☄] ...
|
$this->hit($inc, $data);
|
1 : {"time":0.020473957061767578,"hit_02":1,"hit_obot":1}
1 : []
1 : hit_02 hit_05 hit_1 ***_load time-browser_page_load hit-browser
|
Profiler::info ("iStat/api(". $this->name. ")", $inc + ($data ? ['data' => $data] : []));
$this->goApiSave ($inc, $data);
}
// Compatibility ONLY !! - direct api-socket write
PUBLIC function apcHit(array $inc= [], array $data= [], /* string */ $keys= "", $flush = true ) {
$this->hit($inc, $data);
}
// You DO NOT need this call on web pages - only tests need it
// flush APC cache
function apcFlush($keys, $data= []) {
// do not need this anymore
Statistic_Timing::iStatPageTiming [☄]
|
|
|
else
\Log::text (round ($slow_url[0 ], 1 ) . " " . $slow_url[1 ]['uri'], "slow-pages");
}
# \Log::text ("apcHit($node): ".x2s ($ts). " ".x2s ($slow_url));
// hit_real_visitor is added by /srv/a.uping
i('Stat', $node)->apcHit($ts, $slow_url, $apcHitList);
}
|
|
1 : /rd/vhosts/phone/phoneowner.us/templates/_layout.phtml
|
// $TPL->footer - custom footer elements
foreach ((array )@ $TPL->footer as $h)
echo "\n". $h. "\n";
?>
<? if ("user:pfl_view" == CD ("pingback_stat_key")) { include(T ('/inc/page_timing')); }?>
<? Statistic_Timing::iStatPageTiming(); ?>
</body>
|
include $__["tpl"];
|
1 : _layout
1 : {"body":"<div class= *** </small>\n </div> \n</div> "}
|
//Log::notice ("Template file missed: " . $__["tpl"], "", -1 );
do404 ();
//Controller::dispatch ("/page404", $_GET + $_POST, "_layout");
die;
} else {
include $__["tpl"];
}
Profiler::out ();
} catch(Exception $e) {
$CACHE = false;
// ob_end_flush();
Controller::dispatch [☄] ...
|
show($layout, ['body' => $body]);
|
1 : phone
1 : {"p":"6068482929","c ***and, KY"},"id":5,"tp":"PhoneAddress"}}}}
1 : _layout
|
if (self:: $layout ) {
Profiler::in ("Template:$template");
$body = fetch ($template, $params);
Profiler::out ();
Profiler::in ("Layout", $layout);
show($layout, ['body' => $body]);
Profiler::out ();
return;
}
//Profiler::in ("Template:$template");
show ($template, $params);
Controller::dispatch [☄] ...
|
Controller::dispatch($_SERVER["REDIRECT_URL"], $_GET + $_POST, "_layout");
|
1 : phone
1 : {"p":"6068482929","c ***and, KY"},"id":5,"tp":"PhoneAddress"}}}}
1 : _layout
|
<?
Controller::dispatch($_SERVER["REDIRECT_URL"], $_GET + $_POST, "_layout");
exit; | | | | | | | | | | | | | | | | |