From 8f3646a9c93a06f76f6abb31020fdb74b4b1fc59 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 9 Apr 2023 20:50:33 +0300 Subject: exp: jaeger tracing --- .../src/Jaeger/Thrift/CollectorClient.php | 83 ++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/CollectorClient.php (limited to 'vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/CollectorClient.php') diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/CollectorClient.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/CollectorClient.php new file mode 100644 index 000000000..e3c6e14c1 --- /dev/null +++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/Thrift/CollectorClient.php @@ -0,0 +1,83 @@ +input_ = $input; + $this->output_ = $output ? $output : $input; + } + + public function submitBatches(array $batches) + { + $this->send_submitBatches($batches); + return $this->recv_submitBatches(); + } + + public function send_submitBatches(array $batches) + { + $args = new \Jaeger\Thrift\Collector_submitBatches_args(); + $args->batches = $batches; + $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'submitBatches', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('submitBatches', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_submitBatches() + { + $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\Jaeger\Thrift\Collector_submitBatches_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new \Jaeger\Thrift\Collector_submitBatches_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + throw new \Exception("submitBatches failed: unknown result"); + } + +} + + -- cgit v1.2.3