jlis/quickmetrics-php

A unofficial PHP client for Quickmetrics (quickmetrics.io)

v1.0.0 2019-11-15 13:09 UTC

This package is auto-updated.

Last update: 2024-05-15 23:34:33 UTC


README

Build Status StyleCI

A unofficial PHP client for Quickmetrics (quickmetrics.io)

Install

To install the client you will need to be using Composer in your project. To install it please see the docs.

Install the client using

composer require jlis/quickmetrics-php

Usage

// create the client
$client = new \Jlis\Quickmetrics\Client('quickmetrics api key');

// collect the event
$client->event('event.name', 1.0, 'dimension');

// send the event to Quickmetrics.io
$client->flush();

You can also initialize the client with other options:

$client = new \Jlis\Quickmetrics\Client('your api key', [
    'url' => 'https://someotherurl.tld',
    'max_batch_size' => 10,
    'timeout' => 5,
    'connect_timeout' => 2,
]);

There are the following options:

Option Usage Type Default
url The Quickmetrics API endpoint string https://qckm.io/list
max_batch_size Amount of collected events until a batch request is triggered without the need to call flush() int 100
timeout Number describing the timeout of the request in seconds int 1
connect_timeout Number describing the number of seconds to wait while trying to connect to a server int 1

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Dependencies are managed through composer:

$ composer install

Tests can then be run via phpunit:

$ vendor/bin/phpunit

Thanks

Big thanks to Billomat which let my develop this library during my work time.

68747470733a2f2f7777772e62696c6c6f6d61742e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031392f30372f6c6f676f5f3330305f74725f6f686e65736c6f67616e5f31303030783232362e706e67

License

The MIT License (MIT). Please see License File for more information.