Skip to content
This repository has been archived by the owner on Dec 7, 2019. It is now read-only.

Feature/diagnostics #30

Merged
merged 32 commits into from
May 7, 2013
Merged

Conversation

Thinkscape
Copy link
Member

A flexible, event-based runtime diagnostics component.

Full documentation available in docs folder:
https://github.com/Thinkscape/ZFTool/blob/feature/diagnostics/docs/DIAGNOSTICS.md

I've decided to implement Diagnostics as a feature of ZFTool (as opposed to ZF2) because it depends on configured MVC to gather definitions from config, other modules and then run tests. Despite that, ZFTool\Diagnostics can easily be used standalone, extended and augmented (with EM listeners).

@ghost ghost assigned Thinkscape Apr 7, 2013
@danizord
Copy link

👍

@Thinkscape
Copy link
Member Author

Requesting peer code review @zendframework.

@robertmarsal
Copy link

The short flags (-v, -d, -q) mentioned in the docs are not implemented.

// DiagnosticsController.php
$verbose    = $this->params()->fromRoute('verbose', false);
$debug      = $this->params()->fromRoute('debug', false);
$quiet      = !$verbose && !$debug && $this->params()->fromRoute('quiet', false);

// Should be something like
$verbose    = $this->params()->fromRoute('verbose', false) || $this->params()->fromRoute('v', false);
$debug      = $this->params()->fromRoute('debug', false) || $this->params()->fromRoute('d', false);
$quiet      = !$verbose && !$debug && ($this->params()->fromRoute('quiet', false) || $this->params()->fromRoute('q', false));

@Thinkscape
Copy link
Member Author

Not really. I use arg. grouping and group names in my routes so I don't
need to do these || checks.

Install the module and try for yourself.

Artur Bodera

On 18 kwi 2013, at 11:30, Robert Boloc notifications@github.com wrote:

The short flags (-v, -d, -q) mentioned in the docs are not implemented.

// DiagnosticsController.php$verbose =
$this->params()->fromRoute('verbose', false);$debug =
$this->params()->fromRoute('debug', false);$quiet = !$verbose &&
!$debug && $this->params()->fromRoute('quiet', false);
// Should be something like$verbose =
$this->params()->fromRoute('verbose', false) ||
$this->params()->fromRoute('v', false);$debug =
$this->params()->fromRoute('debug', false) ||
$this->params()->fromRoute('d', false);$quiet = !$verbose &&
!$debug && ($this->params()->fromRoute('quiet', false) ||
$this->params()->fromRoute('q', false));


Reply to this email directly or view it on
GitHubhttps://github.com//pull/30#issuecomment-16566595
.

@robertmarsal
Copy link

I did, that's why I wrote the comment 😜 Strange, maybe there's a bug somewhere.
I tried installing the tool on both module or vendor folders but with same results.

My system is Ubuntu 12.10 with Zend Framework 2.1.5

Captura de 2013-04-18 12:32:25

@Thinkscape
Copy link
Member Author

Thx. I'll check it out...

Artur Bodera

On 18 kwi 2013, at 12:39, Robert Boloc notifications@github.com wrote:

I did, that's why I wrote the comment [image:
😜] Strange, maybe there's a bug somewhere.
I tried installing the tool on both module or vendor folders but with same
results.

My system is Ubuntu 12.10 with Zend Framework 2.1.5

[image: Captura de 2013-04-18
12:32:25]https://f.cloud.github.com/assets/507871/395989/9e06e5bc-a813-11e2-9a0d-9a3bbf83d650.png


Reply to this email directly or view it on
GitHubhttps://github.com//pull/30#issuecomment-16569327
.

@robertmarsal
Copy link

I found the bug in the zf2 console routing. I sent a pull request with the fix zendframework/zendframework#4262

@Thinkscape
Copy link
Member Author

Ready for merge. @ezimuel please take a final look and merge when ready. I'd like to blog about it once it's in. Thanks!

@Thinkscape
Copy link
Member Author

@robertboloc thx for fixing alternative flags aliases. It'll be released with zf 2.2. Until that time, I'm leaving the || blocks in DiagnosticsController. Take a look if everything else checks out for you.

ezimuel added a commit that referenced this pull request May 7, 2013
@ezimuel ezimuel merged commit 7e14adc into zendframework:master May 7, 2013
@lsmith77
Copy link

lsmith77 commented May 7, 2013

i saw someone on twitter mention that he was working on something like this a while ago and pointed them at https://github.com/liip/LiipMonitor. would have been nice to collaborate here .. maybe still possible?

@ezimuel
Copy link
Contributor

ezimuel commented May 7, 2013

Yes, why not? @Thinkscape what do you think?

@Thinkscape
Copy link
Member Author

It's a different approach to the topic. There are some similarities, but mine's more of a framework on which you build your own tests. ZFToold Diag also talks to ZF2 ServiceManager so you can have your checks fetched from there (i.e. factories, classes etc.).

I was also considering a more "general" approach (as that LiipMonitor did), but that would mean having to rewrite Console, forget about using DIC (SM) and other useful features. I've decided to make it as a ZFTool component so people can easily and quickly tie it into existing ZF2 apps without having to think too much :-)

@lsmith77
Copy link

lsmith77 commented May 7, 2013

Hmm I guess I would need to study your code in more detail but LiipMonitor is the basis for LiipMonitorBundle which leverages both the Symfony2 DIC and Console components. While I do not know the ZF2 equivalents I don't see how the provided interfaces would cause issues there either:
https://github.com/liip/LiipMonitorBundle/blob/master/Resources/config/config.yml
https://github.com/liip/LiipMonitorBundle/tree/master/Command

Just to clarify, my proposal for collaboration would be on the interfaces and actual logic to define checks. It absolutely makes sense to then provide tight integration with ZF2 MVC etc.

@Thinkscape
Copy link
Member Author

@lsmith77 Please join the discussion under ticket #39.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants