Skip to content

A inofficial PHP client for Quickmetrics (quickmetrics.io)

License

Notifications You must be signed in to change notification settings

jlis/quickmetrics-php

Repository files navigation

quickmetrics-php

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.

License

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

About

A inofficial PHP client for Quickmetrics (quickmetrics.io)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages