[3/3] ambari git commit: AMBARI-18736. Perf: Simulate alerts for multiple Ambari Agents running on single Host.(vbrodetskyi)
AMBARI-18736. Perf: Simulate alerts for multiple Ambari Agents running on single Host.(vbrodetskyi) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3a342138 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3a342138 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3a342138 Branch: refs/heads/branch-2.5 Commit: 3a342138832357f38a2114fa520f5bb217a654bb Parents: d036e0e Author: Vitaly BrodetskyiAuthored: Thu Dec 1 16:51:17 2016 +0200 Committer: Vitaly Brodetskyi Committed: Thu Dec 1 16:51:17 2016 +0200 -- .../simulate_perf_cluster_alert_behaviour.py| 108 ++ .../stacks/PERF/1.0/services/HAPPY/alerts.json | 20 + .../HAPPY/configuration/happy-alert-config.xml | 75 + .../stacks/PERF/1.0/services/HAPPY/metainfo.xml |5 + .../HAPPY/package/alerts/alert_happy_process.py | 59 + .../stacks/PERF/1.0/services/HBASE/alerts.json | 110 +- .../HBASE/configuration/hbase-alert-config.xml | 75 + .../stacks/PERF/1.0/services/HBASE/metainfo.xml |1 + .../package/alerts/hbase_master_process.py | 59 + .../alerts/hbase_regionserver_process.py| 59 + .../stacks/PERF/1.0/services/HDFS/alerts.json | 1728 +- .../HDFS/configuration/hdfs-alert-config.xml| 75 + .../stacks/PERF/1.0/services/HDFS/metainfo.xml |1 + .../package/alerts/alert_checkpoint_time.py | 38 +- .../alerts/alert_datanode_unmounted_data_dir.py | 47 +- .../package/alerts/alert_ha_namenode_health.py | 75 - .../package/alerts/alert_metrics_deviation.py | 85 - .../package/alerts/alert_nfs_gateway_process.py | 59 + .../package/alerts/alert_snamenode_process.py | 59 + .../package/alerts/alert_upgrade_finalized.py | 49 +- .../stacks/PERF/1.0/services/SLEEPY/alerts.json | 20 + .../configuration/sleepy-alert-config.xml | 75 + .../PERF/1.0/services/SLEEPY/metainfo.xml |5 + .../package/alerts/alert_sleepy_process.py | 59 + .../stacks/PERF/1.0/services/SNOW/alerts.json | 20 + .../SNOW/configuration/snow-alert-config.xml| 75 + .../stacks/PERF/1.0/services/SNOW/metainfo.xml |5 + .../SNOW/package/alerts/alert_snow_process.py | 59 + .../stacks/PERF/1.0/services/YARN/alerts.json | 361 +--- .../YARN/configuration/yarn-alert-config.xml| 75 + .../stacks/PERF/1.0/services/YARN/metainfo.xml |3 + .../package/alerts/alert_history_process.py | 59 + .../package/alerts/alert_nodemanager_health.py | 36 +- .../alerts/alert_nodemanagers_summary.py| 68 - .../alerts/alert_resourcemanager_process.py | 59 + .../package/alerts/alert_timeline_process.py| 59 + .../PERF/1.0/services/ZOOKEEPER/alerts.json | 20 + .../ZOOKEEPER/configuration/zk-alert-config.xml | 75 + .../PERF/1.0/services/ZOOKEEPER/metainfo.xml|4 + .../package/alerts/alert_zk_server_process.py | 59 + 40 files changed, 1510 insertions(+), 2473 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/3a342138/ambari-common/src/main/python/resource_management/libraries/functions/simulate_perf_cluster_alert_behaviour.py -- diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/simulate_perf_cluster_alert_behaviour.py b/ambari-common/src/main/python/resource_management/libraries/functions/simulate_perf_cluster_alert_behaviour.py new file mode 100644 index 000..736e5e3 --- /dev/null +++ b/ambari-common/src/main/python/resource_management/libraries/functions/simulate_perf_cluster_alert_behaviour.py @@ -0,0 +1,108 @@ +#!/usr/bin/env python + +""" +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" +__all__ = ["simulate_perf_cluster_alert_behaviour"] + +import logging +import random +import time + +from datetime import datetime +from resource_management.core.exceptions import Fail + +RESULT_CODE_OK = 'OK' +RESULT_CODE_CRITICAL = 'CRITICAL' +RESULT_CODE_UNKNOWN = 'UNKNOWN' + +OK_MESSAGE = 'Ok'
[3/3] ambari git commit: AMBARI-18736. Perf: Simulate alerts for multiple Ambari Agents running on single Host.(vbrodetskyi)
AMBARI-18736. Perf: Simulate alerts for multiple Ambari Agents running on single Host.(vbrodetskyi) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ef63373e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ef63373e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ef63373e Branch: refs/heads/trunk Commit: ef63373ef2fa886d819589b8500e4c1c81390a87 Parents: 9a72a60 Author: Vitaly BrodetskyiAuthored: Thu Dec 1 16:38:58 2016 +0200 Committer: Vitaly Brodetskyi Committed: Thu Dec 1 16:38:58 2016 +0200 -- .../simulate_perf_cluster_alert_behaviour.py| 108 ++ .../stacks/PERF/1.0/services/HAPPY/alerts.json | 20 + .../HAPPY/configuration/happy-alert-config.xml | 75 + .../stacks/PERF/1.0/services/HAPPY/metainfo.xml |5 + .../HAPPY/package/alerts/alert_happy_process.py | 59 + .../stacks/PERF/1.0/services/HBASE/alerts.json | 110 +- .../HBASE/configuration/hbase-alert-config.xml | 75 + .../stacks/PERF/1.0/services/HBASE/metainfo.xml |1 + .../package/alerts/hbase_master_process.py | 59 + .../alerts/hbase_regionserver_process.py| 59 + .../stacks/PERF/1.0/services/HDFS/alerts.json | 1728 +- .../HDFS/configuration/hdfs-alert-config.xml| 75 + .../stacks/PERF/1.0/services/HDFS/metainfo.xml |1 + .../package/alerts/alert_checkpoint_time.py | 38 +- .../alerts/alert_datanode_unmounted_data_dir.py | 47 +- .../package/alerts/alert_ha_namenode_health.py | 75 - .../package/alerts/alert_metrics_deviation.py | 85 - .../package/alerts/alert_nfs_gateway_process.py | 59 + .../package/alerts/alert_snamenode_process.py | 59 + .../package/alerts/alert_upgrade_finalized.py | 49 +- .../stacks/PERF/1.0/services/SLEEPY/alerts.json | 20 + .../configuration/sleepy-alert-config.xml | 75 + .../PERF/1.0/services/SLEEPY/metainfo.xml |5 + .../package/alerts/alert_sleepy_process.py | 59 + .../stacks/PERF/1.0/services/SNOW/alerts.json | 20 + .../SNOW/configuration/snow-alert-config.xml| 75 + .../stacks/PERF/1.0/services/SNOW/metainfo.xml |5 + .../SNOW/package/alerts/alert_snow_process.py | 59 + .../stacks/PERF/1.0/services/YARN/alerts.json | 361 +--- .../YARN/configuration/yarn-alert-config.xml| 75 + .../stacks/PERF/1.0/services/YARN/metainfo.xml |3 + .../package/alerts/alert_history_process.py | 59 + .../package/alerts/alert_nodemanager_health.py | 36 +- .../alerts/alert_nodemanagers_summary.py| 68 - .../alerts/alert_resourcemanager_process.py | 59 + .../package/alerts/alert_timeline_process.py| 59 + .../PERF/1.0/services/ZOOKEEPER/alerts.json | 20 + .../ZOOKEEPER/configuration/zk-alert-config.xml | 75 + .../PERF/1.0/services/ZOOKEEPER/metainfo.xml|4 + .../package/alerts/alert_zk_server_process.py | 59 + 40 files changed, 1510 insertions(+), 2473 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/ef63373e/ambari-common/src/main/python/resource_management/libraries/functions/simulate_perf_cluster_alert_behaviour.py -- diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/simulate_perf_cluster_alert_behaviour.py b/ambari-common/src/main/python/resource_management/libraries/functions/simulate_perf_cluster_alert_behaviour.py new file mode 100644 index 000..736e5e3 --- /dev/null +++ b/ambari-common/src/main/python/resource_management/libraries/functions/simulate_perf_cluster_alert_behaviour.py @@ -0,0 +1,108 @@ +#!/usr/bin/env python + +""" +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" +__all__ = ["simulate_perf_cluster_alert_behaviour"] + +import logging +import random +import time + +from datetime import datetime +from resource_management.core.exceptions import Fail + +RESULT_CODE_OK = 'OK' +RESULT_CODE_CRITICAL = 'CRITICAL' +RESULT_CODE_UNKNOWN = 'UNKNOWN' + +OK_MESSAGE = 'Ok' +FAIL_MESSAGE =