2017 © Pedro Peláez
 

library phpflo-flowtrace

Log phpflo network execution for debugging and analysis

image

phpflo/phpflo-flowtrace

Log phpflo network execution for debugging and analysis

  • Tuesday, April 18, 2017
  • by asm
  • Repository
  • 2 Watchers
  • 1 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

[READONLY] phpflo-flowtrace

Build Status Code Coverage Scrutinizer Code Quality License, (*1)

Log phpflo network execution for debugging or analysis., (*2)

Tracing events

Every time you want to debug your flows, you need to see the data transitions between your components, the connects/disconnect etc., (*3)

With this library you are now able to do so., (*4)

Setup

It's nearly as simple as using phpflo itself. Add a composer require phpflo/flowtrace and initialise like this:, (*5)

<?php
require __DIR__ . '/../../vendor/autoload.php';

$traceableNetwork = new \PhpFlo\FlowTrace\TraceableNetwork(
    new PhpFlo\Core\Network(
        new PhpFlo\Core\Builder\ComponentFactory()
    ),
    new \PhpFlo\FlowTrace\Logger\SimpleFile(__DIR__ . DIRECTORY_SEPARATOR . 'flow.log', 'info')
);
$traceableNetwork
    ->boot(__DIR__.'/count.fbp')
    ->run($fileName, "ReadFile", "source")
    ->shutdown();

This will dump all your data flows into a flow.log where you can later review. As you might have noticed, the logger has a "level" given, which is PSR3 compatible - in fact, the whole SimpleFile logger is just a basic implementation of the PSR3 AbstractLogger. You can easily replace this logger with your own PSR compatible one. Providing a certain level will give you more detailed information. "debug" will also give you all connects/disconnects, "info" will just provide data flows and data., (*6)

Logs

The logs are compatible with flowbased/flowtrace and reproduce flows within Flowhub., (*7)

Example of reading the count.fbp file (info):, (*8)

-> source ReadFile  DATA examples/linecount/count.fbp
ReadFile out -> in SplitbyLines  DATA ReadFile(ReadFile) out -> in SplitbyLines(SplitStr)
ReadFile(ReadFile) error -> in Display(Output)
SplitbyLines(SplitStr) out -> in CountLines(Counter)
CountLines(Counter) count -> in Display(Output)

SplitbyLines out -> in CountLines  DATA ReadFile(ReadFile) out -> in SplitbyLines(SplitStr)
SplitbyLines out -> in CountLines  DATA ReadFile(ReadFile) error -> in Display(Output)
SplitbyLines out -> in CountLines  DATA SplitbyLines(SplitStr) out -> in CountLines(Counter)
SplitbyLines out -> in CountLines  DATA CountLines(Counter) count -> in Display(Output)
SplitbyLines out -> in CountLines  DATA 
CountLines count -> in Display  DATA i:5;

Example (debug):, (*9)

-> source ReadFile CONN
-> source ReadFile DATA examples/linecount/count.fbp
 ReadFile out -> in SplitbyLines CONN
 ReadFile out -> in SplitbyLines DATA ReadFile(ReadFile) out -> in SplitbyLines(SplitStr)
ReadFile(ReadFile) error -> in Display(Output)
SplitbyLines(SplitStr) out -> in CountLines(Counter)
CountLines(Counter) count -> in Display(Output)

 ReadFile out -> in SplitbyLines DISC
 SplitbyLines out -> in CountLines CONN
 SplitbyLines out -> in CountLines DATA ReadFile(ReadFile) out -> in SplitbyLines(SplitStr)
 SplitbyLines out -> in CountLines DATA ReadFile(ReadFile) error -> in Display(Output)
 SplitbyLines out -> in CountLines DATA SplitbyLines(SplitStr) out -> in CountLines(Counter)
 SplitbyLines out -> in CountLines DATA CountLines(Counter) count -> in Display(Output)
 SplitbyLines out -> in CountLines DATA 
 SplitbyLines out -> in CountLines DISC
 CountLines count -> in Display CONN
 CountLines count -> in Display DATA i:5;
 CountLines count -> in Display DISC
-> source ReadFile DISC

The Versions

18/04 2017

dev-master

9999999-dev

Log phpflo network execution for debugging and analysis

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marc Aschmann

log php fbp flow based programming

21/03 2017

v1.0.0

1.0.0.0

Log phpflo network execution for debugging and analysis

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marc Aschmann

log fbp flow based programming