Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
spadger committed Feb 3, 2025
1 parent 02bb56f commit 922e120
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/API/Common/Time/ClockInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ interface ClockInterface
public const NANOS_PER_SECOND = 1_000_000_000;
public const NANOS_PER_MILLISECOND = 1_000_000;
public const NANOS_PER_MICROSECOND = 1_000;
public const MICROS_PER_MILLISECOND = 1_000;
public const MILLIS_PER_SECOND = 1_000;

/**
Expand Down
3 changes: 2 additions & 1 deletion src/Contrib/Grpc/GrpcTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use const Grpc\OP_SEND_MESSAGE;
use const Grpc\STATUS_OK;
use Grpc\Timeval;
use OpenTelemetry\API\Common\Time\ClockInterface;
use OpenTelemetry\Contrib\Otlp\ContentTypes;
use OpenTelemetry\SDK\Common\Export\TransportInterface;
use OpenTelemetry\SDK\Common\Future\CancellationInterface;
Expand Down Expand Up @@ -49,7 +50,7 @@ public function __construct(
) {
$this->channel = new Channel($endpoint, $opts);
$this->metadata = $this->formatMetadata(array_change_key_case($headers));
$this->exportTimeout = new Timeval($timeoutMillis * 1000);
$this->exportTimeout = new Timeval($timeoutMillis * ClockInterface::MICROS_PER_MILLISECOND);
}

public function contentType(): string
Expand Down
2 changes: 1 addition & 1 deletion src/Contrib/Grpc/GrpcTransportFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function create(
$opts,
$method,
$headers,
(int)($timeout * 1000),
(int) ($timeout * 1000),
);
}

Expand Down

0 comments on commit 922e120

Please sign in to comment.