Skip to content

Commit

Permalink
renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmastech committed Jul 5, 2024
1 parent 5b723a6 commit 2727bae
Show file tree
Hide file tree
Showing 24 changed files with 82 additions and 82 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Cosmastech\StatsDClient\Clients\Concerns;
namespace Cosmastech\StatsDClient\Adapters\Concerns;

use Cosmastech\StatsDClient\TagNormalizers\TagNormalizer;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Cosmastech\StatsDClient\Clients\Contracts;
namespace Cosmastech\StatsDClient\Adapters\Contracts;

use Cosmastech\StatsDClient\TagNormalizers\TagNormalizer;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace Cosmastech\StatsDClient\Clients\Datadog;
namespace Cosmastech\StatsDClient\Adapters\Datadog;

use Cosmastech\StatsDClient\Clients\Concerns\TagNormalizerAwareTrait;
use Cosmastech\StatsDClient\Clients\Contracts\TagNormalizerAware;
use Cosmastech\StatsDClient\Clients\StatsDClient;
use Cosmastech\StatsDClient\Adapters\Concerns\TagNormalizerAwareTrait;
use Cosmastech\StatsDClient\Adapters\Contracts\TagNormalizerAware;
use Cosmastech\StatsDClient\Adapters\StatsDClientAdapter;
use Cosmastech\StatsDClient\TagNormalizers\NoopTagNormalizer;
use DataDog\DogStatsd;

class DatadogStatsDClient implements StatsDClient, TagNormalizerAware
class DatadogStatsDClientAdapter implements StatsDClientAdapter, TagNormalizerAware
{
use TagNormalizerAwareTrait;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<?php

namespace Cosmastech\StatsDClient\Clients\InMemory;

use Cosmastech\StatsDClient\Clients\Concerns\TagNormalizerAwareTrait;
use Cosmastech\StatsDClient\Clients\Contracts\TagNormalizerAware;
use Cosmastech\StatsDClient\Clients\InMemory\Models\InMemoryCountRecord;
use Cosmastech\StatsDClient\Clients\InMemory\Models\InMemoryDistributionRecord;
use Cosmastech\StatsDClient\Clients\InMemory\Models\InMemoryGaugeRecord;
use Cosmastech\StatsDClient\Clients\InMemory\Models\InMemoryHistogramRecord;
use Cosmastech\StatsDClient\Clients\InMemory\Models\InMemorySetRecord;
use Cosmastech\StatsDClient\Clients\InMemory\Models\InMemoryStatsRecord;
use Cosmastech\StatsDClient\Clients\InMemory\Models\InMemoryTimingRecord;
use Cosmastech\StatsDClient\Clients\StatsDClient;
namespace Cosmastech\StatsDClient\Adapters\InMemory;

use Cosmastech\StatsDClient\Adapters\Concerns\TagNormalizerAwareTrait;
use Cosmastech\StatsDClient\Adapters\Contracts\TagNormalizerAware;
use Cosmastech\StatsDClient\Adapters\InMemory\Models\InMemoryCountRecord;
use Cosmastech\StatsDClient\Adapters\InMemory\Models\InMemoryDistributionRecord;
use Cosmastech\StatsDClient\Adapters\InMemory\Models\InMemoryGaugeRecord;
use Cosmastech\StatsDClient\Adapters\InMemory\Models\InMemoryHistogramRecord;
use Cosmastech\StatsDClient\Adapters\InMemory\Models\InMemorySetRecord;
use Cosmastech\StatsDClient\Adapters\InMemory\Models\InMemoryStatsRecord;
use Cosmastech\StatsDClient\Adapters\InMemory\Models\InMemoryTimingRecord;
use Cosmastech\StatsDClient\Adapters\StatsDClientAdapter;
use Cosmastech\StatsDClient\TagNormalizers\NoopTagNormalizer;
use Psr\Clock\ClockInterface;

class InMemoryClient implements StatsDClient, TagNormalizerAware
class InMemoryClientAdapter implements StatsDClientAdapter, TagNormalizerAware
{
use TagNormalizerAwareTrait;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Cosmastech\StatsDClient\Clients\InMemory\Models;
namespace Cosmastech\StatsDClient\Adapters\InMemory\Models;

use DateTimeImmutable;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Cosmastech\StatsDClient\Clients\InMemory\Models;
namespace Cosmastech\StatsDClient\Adapters\InMemory\Models;

use DateTimeImmutable;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Cosmastech\StatsDClient\Clients\InMemory\Models;
namespace Cosmastech\StatsDClient\Adapters\InMemory\Models;

use DateTimeImmutable;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Cosmastech\StatsDClient\Clients\InMemory\Models;
namespace Cosmastech\StatsDClient\Adapters\InMemory\Models;

use DateTimeImmutable;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Cosmastech\StatsDClient\Clients\InMemory\Models;
namespace Cosmastech\StatsDClient\Adapters\InMemory\Models;

use DateTimeImmutable;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Cosmastech\StatsDClient\Clients\InMemory\Models;
namespace Cosmastech\StatsDClient\Adapters\InMemory\Models;

class InMemoryStatsRecord
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Cosmastech\StatsDClient\Clients\InMemory\Models;
namespace Cosmastech\StatsDClient\Adapters\InMemory\Models;

use DateTimeImmutable;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?php

namespace Cosmastech\StatsDClient\Clients\League;
namespace Cosmastech\StatsDClient\Adapters\League;

use Cosmastech\StatsDClient\Clients\Concerns\TagNormalizerAwareTrait;
use Cosmastech\StatsDClient\Clients\Contracts\TagNormalizerAware;
use Cosmastech\StatsDClient\Clients\StatsDClient;
use Cosmastech\StatsDClient\Adapters\Concerns\TagNormalizerAwareTrait;
use Cosmastech\StatsDClient\Adapters\Contracts\TagNormalizerAware;
use Cosmastech\StatsDClient\Adapters\StatsDClientAdapter;
use Cosmastech\StatsDClient\Utility\SampleRateDecider\Contracts\SampleRateSendDecider as SampleRateSendDeciderInterface;
use Cosmastech\StatsDClient\Utility\SampleRateDecider\SampleRateSendDecider;
use League\StatsD\Client;
use League\StatsD\Exception\ConfigurationException;
use League\StatsD\Exception\ConnectionException;
use League\StatsD\StatsDClient as LeagueStatsDClientInterface;

class LeagueStatsDClient implements StatsDClient, TagNormalizerAware
class LeagueStatsDClientAdapter implements StatsDClientAdapter, TagNormalizerAware
{
use TagNormalizerAwareTrait;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace Cosmastech\StatsDClient\Clients;
namespace Cosmastech\StatsDClient\Adapters;

interface StatsDClient
interface StatsDClientAdapter
{
public function timing(string $stat, float $durationMs, float $sampleRate = 1.0, array $tags = []): void;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Cosmastech\StatsDClient\Datadog;
namespace Cosmastech\StatsDClient\Clients\Datadog;

use DataDog\DogStatsd;
use Psr\Log\LoggerInterface;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Cosmastech\StatsDClient\Tests\Clients\InMemory;
namespace Cosmastech\StatsDClient\Tests\Adapters\InMemory;

use Cosmastech\StatsDClient\Clients\InMemory\InMemoryClient;
use Cosmastech\StatsDClient\Adapters\InMemory\InMemoryClientAdapter;
use Cosmastech\StatsDClient\Tests\BaseTestCase;
use Cosmastech\StatsDClient\Tests\ClockStub;
use Cosmastech\StatsDClient\Tests\Doubles\ClockStub;
use Cosmastech\StatsDClient\Tests\Doubles\TagNormalizerSpy;
use DateTimeImmutable;
use PHPUnit\Framework\Attributes\Test;
Expand All @@ -17,7 +17,7 @@ public function recordsCountRecord()
// Given
$stubDateTime = new DateTimeImmutable("2024-02-18 14:22:19");

$inMemoryClient = new InMemoryClient(
$inMemoryClient = new InMemoryClientAdapter(
new ClockStub($stubDateTime)
);

Expand All @@ -37,7 +37,7 @@ public function recordsCountRecord()
public function normalizesTags()
{
// Given
$inMemoryClient = new InMemoryClient(new ClockStub(new DateTimeImmutable()));
$inMemoryClient = new InMemoryClientAdapter(new ClockStub(new DateTimeImmutable()));

// And
$tagNormalizerSpy = new TagNormalizerSpy();
Expand All @@ -54,7 +54,7 @@ public function normalizesTags()
public function positiveValue_convertsToANegativeNumber()
{
// Given
$inMemoryClient = new InMemoryClient(new ClockStub(new DateTimeImmutable()));
$inMemoryClient = new InMemoryClientAdapter(new ClockStub(new DateTimeImmutable()));

// When
$inMemoryClient->decrement("some-stat", value: 1845);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Cosmastech\StatsDClient\Tests\Clients\InMemory;
namespace Cosmastech\StatsDClient\Tests\Adapters\InMemory;

use Cosmastech\StatsDClient\Clients\InMemory\InMemoryClient;
use Cosmastech\StatsDClient\Adapters\InMemory\InMemoryClientAdapter;
use Cosmastech\StatsDClient\Tests\BaseTestCase;
use Cosmastech\StatsDClient\Tests\ClockStub;
use Cosmastech\StatsDClient\Tests\Doubles\ClockStub;
use Cosmastech\StatsDClient\Tests\Doubles\TagNormalizerSpy;
use DateTimeImmutable;
use PHPUnit\Framework\Attributes\Test;
Expand All @@ -16,7 +16,7 @@ public function storesGaugeRecord()
{
// Given
$stubDateTime = new DateTimeImmutable("2018-02-13 18:50:00");
$inMemoryClient = new InMemoryClient(new ClockStub($stubDateTime));
$inMemoryClient = new InMemoryClientAdapter(new ClockStub($stubDateTime));

// When
$inMemoryClient->gauge("gauge-stat", 23488);
Expand All @@ -37,7 +37,7 @@ public function storesGaugeRecord()
public function normalizesTags()
{
// Given
$inMemoryClient = new InMemoryClient(new ClockStub(new DateTimeImmutable()));
$inMemoryClient = new InMemoryClientAdapter(new ClockStub(new DateTimeImmutable()));

// And
$tagNormalizerSpy = new TagNormalizerSpy();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Cosmastech\StatsDClient\Tests\Clients\InMemory;
namespace Cosmastech\StatsDClient\Tests\Adapters\InMemory;

use Cosmastech\StatsDClient\Clients\InMemory\InMemoryClient;
use Cosmastech\StatsDClient\Adapters\InMemory\InMemoryClientAdapter;
use Cosmastech\StatsDClient\Tests\BaseTestCase;
use Cosmastech\StatsDClient\Tests\ClockStub;
use Cosmastech\StatsDClient\Tests\Doubles\ClockStub;
use Cosmastech\StatsDClient\Tests\Doubles\TagNormalizerSpy;
use DateTimeImmutable;
use PHPUnit\Framework\Attributes\Test;
Expand All @@ -16,7 +16,7 @@ public function storesHistogramRecord()
{
// Given
$stubDateTime = new DateTimeImmutable("2018-02-13 18:50:00");
$inMemoryClient = new InMemoryClient(new ClockStub($stubDateTime));
$inMemoryClient = new InMemoryClientAdapter(new ClockStub($stubDateTime));

// When
$inMemoryClient->histogram(
Expand All @@ -42,7 +42,7 @@ public function storesHistogramRecord()
public function normalizesTags()
{
// Given
$inMemoryClient = new InMemoryClient(new ClockStub(new DateTimeImmutable()));
$inMemoryClient = new InMemoryClientAdapter(new ClockStub(new DateTimeImmutable()));

// And
$tagNormalizerSpy = new TagNormalizerSpy();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace Cosmastech\StatsDClient\Tests\Clients\InMemory;
namespace Cosmastech\StatsDClient\Tests\Adapters\InMemory;

use Cosmastech\StatsDClient\Clients\InMemory\InMemoryClient;
use Cosmastech\StatsDClient\Clients\InMemory\Models\InMemoryCountRecord;
use Cosmastech\StatsDClient\Adapters\InMemory\InMemoryClientAdapter;
use Cosmastech\StatsDClient\Adapters\InMemory\Models\InMemoryCountRecord;
use Cosmastech\StatsDClient\Tests\BaseTestCase;
use Cosmastech\StatsDClient\Tests\ClockStub;
use Cosmastech\StatsDClient\Tests\Doubles\ClockStub;
use Cosmastech\StatsDClient\Tests\Doubles\TagNormalizerSpy;
use DateTimeImmutable;
use PHPUnit\Framework\Attributes\Test;
Expand All @@ -17,7 +17,7 @@ public function recordsCountRecord()
{
// Given
$stubDateTime = new DateTimeImmutable("2024-01-19 00:00:00");
$inMemoryClient = new InMemoryClient(
$inMemoryClient = new InMemoryClientAdapter(
new ClockStub($stubDateTime)
);

Expand All @@ -41,7 +41,7 @@ public function recordsCountRecord()
public function recordsTags()
{
// Given
$inMemoryClient = new InMemoryClient(new ClockStub(new DateTimeImmutable()));
$inMemoryClient = new InMemoryClientAdapter(new ClockStub(new DateTimeImmutable()));

// When
$inMemoryClient->increment("hello", tags: ["abc" => 199, "xyz" => "end"]);
Expand All @@ -55,7 +55,7 @@ public function recordsTags()
public function normalizesTags()
{
// Given
$inMemoryClient = new InMemoryClient(new ClockStub(new DateTimeImmutable()));
$inMemoryClient = new InMemoryClientAdapter(new ClockStub(new DateTimeImmutable()));

// And
$tagNormalizerSpy = new TagNormalizerSpy();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Cosmastech\StatsDClient\Tests\Clients\InMemory;
namespace Cosmastech\StatsDClient\Tests\Adapters\InMemory;

use Cosmastech\StatsDClient\Clients\InMemory\InMemoryClient;
use Cosmastech\StatsDClient\Adapters\InMemory\InMemoryClientAdapter;
use Cosmastech\StatsDClient\Tests\BaseTestCase;
use Cosmastech\StatsDClient\Tests\ClockStub;
use Cosmastech\StatsDClient\Tests\Doubles\ClockStub;
use Cosmastech\StatsDClient\Tests\Doubles\TagNormalizerSpy;
use DateTimeImmutable;
use PHPUnit\Framework\Attributes\Test;
Expand All @@ -16,7 +16,7 @@ public function storesSetRecord()
{
// Given
$stubDateTime = new DateTimeImmutable("2018-02-13 18:50:00");
$inMemoryClient = new InMemoryClient(new ClockStub($stubDateTime));
$inMemoryClient = new InMemoryClientAdapter(new ClockStub($stubDateTime));

// When
$inMemoryClient->set("set-test", 14);
Expand All @@ -37,7 +37,7 @@ public function storesSetRecord()
public function normalizesTags()
{
// Given
$inMemoryClient = new InMemoryClient(new ClockStub(new DateTimeImmutable()));
$inMemoryClient = new InMemoryClientAdapter(new ClockStub(new DateTimeImmutable()));

// And
$tagNormalizerSpy = new TagNormalizerSpy();
Expand Down
Loading

0 comments on commit 2727bae

Please sign in to comment.