You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by amiryesh <gi...@git.apache.org> on 2017/01/30 21:03:02 UTC

[GitHub] incubator-trafficcontrol pull request #240: [TC-99] api/{version}/cdns/:cdn_...

GitHub user amiryesh opened a pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/240

    [TC-99] api/{version}/cdns/:cdn_name/health returns the health of all\u2026

    \u2026 cdns
    
    Both `/api/$version/cdns/:name/health` and `/api/$version/cdns/health`  route to `Cdn#health`. 
    
    Problem: 
    The `health` method called `get_cache_health()` without passing cdn_name as an argument, resulting with an aggregated health status.
    
    Fix:
    The `health` method extracts `:name` from request, and pass to `get_cache_health()` method

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/amiryesh/incubator-trafficcontrol tc-99

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-trafficcontrol/pull/240.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #240
    
----
commit 1c65c37424a33dc2f3063df529bf910ed5eb2a01
Author: Amir Yeshurun <am...@qwilt.com>
Date:   2017-01-30T20:38:38Z

    [TC-99] api/{version}/cdns/:cdn_name/health returns the health of all cdns

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol pull request #240: [TC-99] api/{version}/cdns/:cdn_...

Posted by amiryesh <gi...@git.apache.org>.
Github user amiryesh commented on a diff in the pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/240#discussion_r98848532
  
    --- Diff: traffic_ops/app/lib/MojoPlugins/Health.pm ---
    @@ -159,6 +159,9 @@ sub register {
     				cachegroups  => [],
     			};
     
    +			$self->app->log->debug("get_cache_health() - " . 
    --- End diff --
    
    I think that a good practice would be to leave debug messages in the code, and set the default log level, at least in production, to "info", so that debug messages will not clutter production logs.
    
    Since the current log level (defined in log4perl.conf) is "debug" (in all environments) I'd suggest to to change this message's log level from "debug" to "trace". 



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol pull request #240: [TC-99] api/{version}/cdns/:cdn_...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-trafficcontrol/pull/240


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol pull request #240: [TC-99] api/{version}/cdns/:cdn_...

Posted by dangogh <gi...@git.apache.org>.
Github user dangogh commented on a diff in the pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/240#discussion_r98947371
  
    --- Diff: traffic_ops/app/lib/MojoPlugins/Health.pm ---
    @@ -159,6 +159,9 @@ sub register {
     				cachegroups  => [],
     			};
     
    +			$self->app->log->debug("get_cache_health() - " . 
    --- End diff --
    
    At first,  it would seem good practice,  but over time more of these would end up in the code.  If placed in a time-critical part of the code,  it could end up affecting performance.   We avoid this practice.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafficcontrol pull request #240: [TC-99] api/{version}/cdns/:cdn_...

Posted by mitchell852 <gi...@git.apache.org>.
Github user mitchell852 commented on a diff in the pull request:

    https://github.com/apache/incubator-trafficcontrol/pull/240#discussion_r98784396
  
    --- Diff: traffic_ops/app/lib/MojoPlugins/Health.pm ---
    @@ -159,6 +159,9 @@ sub register {
     				cachegroups  => [],
     			};
     
    +			$self->app->log->debug("get_cache_health() - " . 
    --- End diff --
    
    can you remove this? we don't typically leave debug statements in the code. thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---