Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

ported all Checks from LiipMonitor (fixes #3) #10

Merged
merged 15 commits into from
Aug 24, 2013

Conversation

lsmith77
Copy link
Contributor

No description provided.

@stof
Copy link
Contributor

stof commented Jul 16, 2013

There is some overlap with #8

{
foreach ($this->extensions as $extension) {
if (!extension_loaded($extension)) {
return new Failure(sprintf('Extension %s not loaded', $extension));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't it be better to report all missing extensions instead of only the first one ? It would be consistent with WritableDirectoryCheck

@Thinkscape
Copy link
Member

Oh no @lsmith77.
It seems that your feature/runner-tweaks now contain new checks from liip (!?).
https://github.com/zendframework/ZendDiagnostics/tree/feature/runner-tweaks/src/ZendDiagnostics/Check

@lsmith77
Copy link
Contributor Author

yes .. #11 includes #10 and #9. but like i said #11 is not really meant to be merged as this point. more a place to discuss some changes I would like to see. #9 should be merged first. #10 still needs to have the tests ported.

use ZendDiagnostics\Result\Failure;
use ZendDiagnostics\Result\Success;

class DiscUsageCheck extends AbstractCheck
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in class name (and file name).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please drop Check suffix from class names because we already have a NS for this:

ZendDiagnostics\Check\DiskSpace
// instead of 
ZendDiagnostics\Check\DiskSpaceCheck

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok fine for me

@lsmith77
Copy link
Contributor Author

not sure if i will have time this week. if you have time. feel free to do any changes in this branch/PR

$memcache = new \Memcache();
$memcache->addServer($this->host, $this->port);
$stats = @$memcache->getExtendedStats();
$available = $stats[$this->host . ':' . $this->port] !== false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is hairy! In case the \Memcache class is missing it will crash. In case addServer doesn't work as it's supposed to, it will crash. In case getExtendedStats() doesn't work as expected, you'll get a php notice (because $array[] will be missing a key).

I believe it should start with checking if MemCache is available at all and throw a Failure otherwise... then it should be able to work around problems with incompatible versions and data coming from methods...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

@Thinkscape
Copy link
Member

@lsmith77 Ok, I'll take care of those changes tomo.

I'll also show you my alternative implementation of DiskFree with support for absolute values (i.e. DiskFree("500M"))

@ghost ghost assigned lsmith77 Jul 18, 2013
@Thinkscape
Copy link
Member

As per my previous comment, I've created PR #13 for DiskFree check, which allows for absolute byte value disk space checks.

@@ -0,0 +1,46 @@
<?php
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this check is redundant and should therefore be removed from the PR?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we could port the "percent" functionality into DiskFree - i.e. if the suffix is % then it'd perform a relative calculation. How do you like this idea ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

lsmith77 and others added 4 commits August 14, 2013 15:36
- Refactor class names (remove "Check" suffix).
- Remove Check\WritableDirectory as it overlaps Check\DirWritable.
- Replace occurrences of "Disc" with "Disk".
- Remove getName() methods, as they do not add any value to default implementation of AbstractCheck::getName() and ::getLabel().
@lsmith77
Copy link
Contributor Author

merge?

@Thinkscape
Copy link
Member

What's the coverage % ?

@lsmith77
Copy link
Contributor Author

no clue .. I guess we can add --coverage-text to travis .. actually us travis even enabled for this repo?

@Thinkscape
Copy link
Member

HttpService and Memcache have no tests, other than that it, looks cool.
Good job! :-)
image

Thinkscape added a commit that referenced this pull request Aug 24, 2013
ported all Checks from LiipMonitor (fixes #3)
@Thinkscape Thinkscape merged commit ce38bcc into master Aug 24, 2013
@Thinkscape
Copy link
Member

Can you add travis on master?

Artur Bodera

On 24 sie 2013, at 17:24, Lukas Kahwe Smith notifications@github.com
wrote:

no clue .. I guess we can add --coverage-text to travis .. actually us
travis even enabled for this repo?


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

@lsmith77
Copy link
Contributor Author

all ready have a .travis.yml config file in master. i can add the code coverage option. however i cannot enable the travis hook. only the owner can do this.

@lsmith77 lsmith77 deleted the feature/liip-monitor-checks branch August 25, 2013 07:12
@Thinkscape
Copy link
Member

Enabled.

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

Successfully merging this pull request may close these issues.

None yet

3 participants