-
Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy pathHTTP2.php
More file actions
44 lines (31 loc) · 788 Bytes
/
Copy pathHTTP2.php
File metadata and controls
44 lines (31 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
require_once dirname(dirname(dirname(dirname(__FILE__)))).'/autoload.php';
use Jaeger\Config;
use GuzzleHttp\Client;
use OpenTracing\Formats;
use OpenTracing\Reference;
unset($_SERVER['argv']);
//init server span start
$config = Config::getInstance();
$tracer = $config->initTracer('example', '0.0.0.0:6831');
$top = $tracer->startActiveSpan('level top');
$second = $tracer->startActiveSpan('level second');
$third = $tracer->startActiveSpan('level third');
$num = 0;
for ($i = 0; $i < 10; $i++){
++$num;
}
$third->getSpan()->setTag("num", $num);
sleep(1);
$third->close();
$num = 0;
for ($i = 0; $i < 10; $i++){
$num += 2;
}
$third->getSpan()->setTag("num", $num);
sleep(1);
$second->close();
$top->close();
//trace flush
$config->flush();
echo "success\r\n";