ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From swa...@apache.org
Subject ambari git commit: Revert "AMBARI-9084 Refine Smoke test for AMS. Smoke test failure on CentOS5. (dsen)"
Date Fri, 16 Jan 2015 21:36:06 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 7330d0eac -> d7ca3036e


Revert "AMBARI-9084 Refine Smoke test for AMS. Smoke test failure on CentOS5. (dsen)"

This reverts commit 0a1d66488ea4a512c23baacd7e629772afd2f717.


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d7ca3036
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d7ca3036
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d7ca3036

Branch: refs/heads/trunk
Commit: d7ca3036e59348cfbfcdc01c38c602241e0741f9
Parents: 7330d0e
Author: Siddharth Wagle <swagle@hortonworks.com>
Authored: Fri Jan 16 13:35:29 2015 -0800
Committer: Siddharth Wagle <swagle@hortonworks.com>
Committed: Fri Jan 16 13:35:57 2015 -0800

----------------------------------------------------------------------
 ambari-server/pom.xml                           |  1 -
 .../AMS/0.1.0/package/scripts/params.py         |  3 +-
 .../AMS/0.1.0/package/scripts/service_check.py  | 96 --------------------
 .../package/templates/smoketest_metrics.json.j2 | 15 ---
 4 files changed, 1 insertion(+), 114 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d7ca3036/ambari-server/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index 21b65af..43832c9 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -166,7 +166,6 @@
             <exclude>src/main/resources/stacks/HDP/2.1.GlusterFS/services/YARN/package/templates/exclude_hosts_list.j2</exclude>
             <exclude>src/main/windows/ambari-server.cmd</exclude>
             <exclude>src/main/windows/ambari-server.ps1</exclude>
-            <exclude>src/main/resources/common-services/AMS/0.1.0/package/templates/smoketest_metrics.json.j2</exclude>
             <exclude>src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/balancer-emulator/balancer-err.log</exclude>
             <exclude>src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/balancer-emulator/balancer.log</exclude>
             <exclude>src/main/resources/stacks/BIGTOP/0.8/services/HDFS/package/scripts/balancer-emulator/balancer.log</exclude>

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7ca3036/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/params.py
b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/params.py
index aff8588..efe0d28 100644
--- a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/params.py
@@ -38,8 +38,7 @@ ams_collector_script = "/usr/sbin/ambari-metrics-collector"
 ams_collector_pid_dir = status_params.ams_collector_pid_dir
 ams_collector_hosts = default("/clusterHostInfo/metric_collector_hosts", [])
 ams_collector_host_single = ams_collector_hosts[0] #TODO cardinality is 1+ so we can have
more than one host
-metric_collector_address = default("/configurations/ams-site/timeline.metrics.service.webapp.address",
"0.0.0.0:6188")
-metric_collector_port = default("/configurations/ams-site/timeline.metrics.service.webapp.address",
"0.0.0.0:6188")
+metric_collector_port = default("/configurations/ams-site/timeline.metrics.service.webapp.address",
"0.0.0.0:8188")
 if metric_collector_port and metric_collector_port.find(':') != -1:
   metric_collector_port = metric_collector_port.split(':')[1]
 pass

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7ca3036/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/service_check.py
b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/service_check.py
index cc45aeb..5561e10 100644
--- a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/service_check.py
+++ b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/scripts/service_check.py
@@ -17,99 +17,3 @@ See the License for the specific language governing permissions and
 limitations under the License.
 
 """
-
-from resource_management.core.logger import Logger
-from resource_management.core.base import Fail
-from resource_management import Script
-from resource_management import Template
-import httplib
-import urllib
-import json
-import random
-import time
-
-
-class AMSServiceCheck(Script):
-
-  AMS_METRICS_POST_URL = "/ws/v1/timeline/metrics/"
-  AMS_METRICS_GET_URL = "/ws/v1/timeline/metrics?%s"
-
-  def service_check(self, env):
-    import params
-
-    Logger.info("AMS service check was started.")
-    env.set_params(params)
-
-    random_value1 = random.random()
-    current_time = time.time()
-    metric_json = Template('smoketest_metrics.json.j2', hostname=params.hostname, random1=random_value1,
-                           current_time=current_time).get_content()
-    Logger.info("Generated metrics:\n%s" % metric_json)
-
-    Logger.info("Connecting (POST) to %s%s" % (params.metric_collector_address, self.AMS_METRICS_POST_URL))
-    headers = {"Content-type": "application/json"}
-    conn = httplib.HTTPConnection(params.metric_collector_address)
-
-    conn.request("POST", self.AMS_METRICS_POST_URL, metric_json, headers)
-    response = conn.getresponse()
-    Logger.info("Http response: %s %s" % (response.status, response.reason))
-
-    data = response.read()
-    Logger.info("Http data: %s" % data)
-    conn.close()
-
-    if response.status == 200:
-      Logger.info("AMS metrics were saved.")
-    else:
-      Logger.info("AMS metrics were not saved. Service check has failed.")
-      raise Fail("AMS metrics were not saved. Service check has failed. POST request status:
%s %s \n%s" %
-                 (response.status, response.reason, data))
-
-    get_metrics_parameters = {
-      "metricNames": "AMS.SmokeTest.FakeMetric",
-      "appId": "amssmoketestfake",
-      "hostname": params.hostname,
-      "startTime": 1419860000000,
-      "precision": "seconds",
-      "grouped": "false",
-    }
-    encoded_get_metrics_parameters = urllib.urlencode(get_metrics_parameters)
-
-    Logger.info("Connecting (GET) to %s%s" % (params.metric_collector_address,
-                                              self.AMS_METRICS_GET_URL % encoded_get_metrics_parameters))
-
-    conn = httplib.HTTPConnection(params.metric_collector_address)
-    conn.request("GET", self.AMS_METRICS_GET_URL % encoded_get_metrics_parameters)
-    response = conn.getresponse()
-    Logger.info("Http response: %s %s" % (response.status, response.reason))
-
-    data = response.read()
-    Logger.info("Http data: %s" % data)
-    conn.close()
-
-    if response.status == 200:
-      Logger.info("AMS metrics were retrieved.")
-    else:
-      Logger.info("AMS metrics were not retrieved. Service check has failed.")
-      raise Fail("AMS metrics were not retrieved. Service check has failed. GET request status:
%s %s \n%s" %
-                 (response.status, response.reason, data))
-    data_json = json.loads(data)
-
-    def floats_eq(f1, f2, delta):
-      return abs(f1-f2) < delta
-
-    for metrics_data in data_json["metrics"]:
-      if (floats_eq(metrics_data["metrics"]["1419860001000"], random_value1, 0.0000001)
-          and floats_eq(metrics_data["metrics"]["1419860002000"], current_time, 1)):
-        Logger.info("Values %s and %s were found in response." % (random_value1, current_time))
-        break
-      pass
-    else:
-      Logger.info("Values %s and %s were not found in response." % (random_value1, current_time))
-      raise Fail("Values %s and %s were not found in response." % (random_value1, current_time))
-
-    Logger.info("AMS service check is finished.")
-
-if __name__ == "__main__":
-  AMSServiceCheck().execute()
-

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7ca3036/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/smoketest_metrics.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/smoketest_metrics.json.j2
b/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/smoketest_metrics.json.j2
deleted file mode 100644
index e2e8501..0000000
--- a/ambari-server/src/main/resources/common-services/AMS/0.1.0/package/templates/smoketest_metrics.json.j2
+++ /dev/null
@@ -1,15 +0,0 @@
-{
-  "metrics": [
-    {
-      "metricname": "AMS.SmokeTest.FakeMetric",
-      "appid": "amssmoketestfake",
-      "hostname": "{{hostname}}",
-      "timestamp": 1419860001000,
-      "starttime": 1419860001000,
-      "metrics": {
-        "1419860001000": {{random1}},
-        "1419860002000": {{current_time}}
-      }
-    }
-  ]
-}


Mime
View raw message