Skip to content

Commit

Permalink
Improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
antonkomarev committed Sep 1, 2024
1 parent 4e34fd6 commit 4b4759a
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,25 @@ $httpClient = \Http\Adapter\Guzzle7\Client::createWithConfig(
);
$openTsdbBaseUri = 'http://localhost:4242';

$openTsdbClient = new OpenTsdbClient(
$openTsdbClient = new \Cog\OpenTsdbClient\OpenTsdbClient(
$httpClient,
$openTsdbBaseUri,
);

$metricName = 'test_metric';
$metricUnixTime = time();
$metricValue = 42;
$metricTags = ['tag1_name' => 'tag1_value'];

$dataPointList = new DataPoint(
$metricName,
$metricUnixTime,
$metricValue,
$metricTags,
$dataPointList[] = new \Cog\OpenTsdbClient\DataPoint(
metric: 'temperature',
timestamp: time(),
value: -38.04,
tags: ['place' => 'south_pole'],
);
$dataPointList[] = new \Cog\OpenTsdbClient\DataPoint(
metric: 'temperature',
timestamp: time(),
value: -2.12,
tags: ['place' => 'north_pole'],
);

$this->openTsdbClient->sendDataPoints([$dataPointList]);
$this->openTsdbClient->sendDataPoints($dataPointList);
```

## Alternatives
Expand Down

0 comments on commit 4b4759a

Please sign in to comment.