2017 © Pedro Peláez
 

library insights

Convenient interface for using New Relic Insights

image

sobit/insights

Convenient interface for using New Relic Insights

  • Monday, October 5, 2015
  • by sobit
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 1 Versions
  • 13 % Grown

The README.md

Insights

SensioLabsInsight, (*1)

Convenient interface for using New Relic Insights., (*2)

Install

Via Composer:, (*3)

``` json { "require": { "sobit/insights": "dev-master" } }, (*4)


## Usage ### 1. Creating your event Create your event which extends ```\Sobit\Insights\AbstractEvent``` class and set preferred event type. ``` php class MyEvent extends \Sobit\Insights\AbstractEvent { public function getEventType() { return 'SomeEvent'; } }

Populate this class with attributes you want to be submitted to Insights:, (*5)

``` php class MyEvent extends Sobit\Insights\AbstractEvent { private $myAttribute;, (*6)

public function __construct($myAttribute)
{
    $this->myAttribute = $myAttribute;
}

public function getEventType()
{
    return 'SomeEvent';
}

}, (*7)


### 2. Submitting events ``` php use Sobit\Insights\Client\Client; use Sobit\Insights\EventManager; // configuration values as per New Relic Insights $accountId = 'YOUR ACCOUNT ID'; $insertKey = 'YOUR INSERT KEY'; $queryKey = 'YOUR QUERY KEY'; // initialize core classes $client = new Client(new GuzzleHttp\Client(), $accountId, $insertKey, $queryKey); $eventManager = new EventManager($client, JMS\Serializer\SerializerBuilder::create()->build()); // create your event $event = new MyEvent('some attribute'); // submit event to Insights $eventManager->persist($event); $eventManager->flush();

To do

  1. NRQL query builder
  2. Improve documentation
  3. Cover functionality with unit tests

License

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

The Versions

05/10 2015

dev-master

9999999-dev https://github.com/sobit/insights

Convenient interface for using New Relic Insights

  Sources   Download

MIT

The Requires

 

by Sobit Akhmedov

new relic insights