コード例 #1
0
  def __init__(self):
    # Make sure we have the latest version of configuration
    htm-it.app.config.loadConfig()

    self._log = getExtendedLogger(self.__class__.__name__)
    self._modelResultsExchange = (
      htm-it.app.config.get("metric_streamer", "results_exchange_name"))
コード例 #2
0
from htm-it import logging_support
from htm-it.htm-it_logging import getExtendedLogger

import htm-it.app
import htm-it.app.adapters.datasource as datasource_adapter_factory
from htm-it.app.adapters.datasource.cloudwatch import aws_base
from htm-it.app import repository
from htm-it.app.repository.queries import MetricStatus
from htmengine.utils import jsonDecode

from htm-it.test_utils.app.test_case_base import TestCaseBase, unittest
import htm-it.test_utils.aws_utils



_LOG = getExtendedLogger("cw_datasource_adapter_metrics_test")



def setUpModule():
  logging_support.LoggingSupport.initTestApp()




class CloudwatchDatasourceAdapterMetricsTest(TestCaseBase):

  _supportedResourceTypes = [
    aws_base.ResourceTypeNames.EC2_INSTANCE,
    aws_base.ResourceTypeNames.AUTOSCALING_GROUP,
    #aws_base.ResourceTypeNames.DYNAMODB_TABLE, (NO DATA)
コード例 #3
0
      self._log.exception("RabbitMQ connection failed")
      raise
    except amqp.exceptions.AmqpChannelError:
      self._log.exception("RabbitMQ channel failed")
      raise
    except Exception as ex:
      self._log.exception("Error Streaming data: %s", ex)
      raise
    except KeyboardInterrupt:
      self._log.info("Stopping htm-it Notification Service: KeyboardInterrupt")
    finally:
      self._log.info("HTM-IT Notification Service is exiting")



if __name__ == "__main__":
  g_log = getExtendedLogger("NotificationService")
  logging_support.LoggingSupport.initService()
  try:
    NotificationService().run()
  except KeyboardInterrupt:
    pass
  except Exception as e:
    outp = StringIO.StringIO()
    ex_type, ex, tb = sys.exc_info()
    traceback.print_tb(tb, file=outp)
    outp.seek(0)
    g_log.info(outp.read())
    g_log.exception("Unexpected Error")
    sys.exit(1)
コード例 #4
0
def setUpModule():
  logging_support.LoggingSupport.initTestApp()

  global g_log  # pylint: disable=W0603
  g_log = getExtendedLogger("autostack_datasource_adapter_test")
コード例 #5
0
import htm-it.app
import htm-it.app.adapters.datasource as datasource_adapter_factory
from htm-it.app.adapters.datasource.cloudwatch import aws_base
import htm-it.app.exceptions as app_exceptions
from htm-it.app import repository
from htm-it.app.repository import schema
from htmengine.repository.queries import MetricStatus
import htmengine.utils

from htm-it.test_utils.app.test_case_base import TestCaseBase, unittest
import htm-it.test_utils.aws_utils



_LOG = getExtendedLogger("cw_datasource_adapter_base_test")



class CloudwatchDatasourceAdapterBaseTest(TestCaseBase):

  # EC2 Region name of the test ec2 instance
  _testRegion = None
  _testId = None

  _modelSpecNoMinMax = None
  _modelSpecWithMinMax = None

  # What we expect to be supported so far
  _expectedResourceTypes = [
    aws_base.ResourceTypeNames.EC2_INSTANCE,
コード例 #6
0
ファイル: webapp.py プロジェクト: darian19/numenta-apps
                                  metrics_api,
                                  models_api,
                                  notifications_api,
                                  settings_api,
                                  support_api,
                                  update_api,
                                  wufoo_api,
                                  UnauthorizedResponse)
from htm-it.app.webservices.utils import encodeJson
from htmengine.utils import jsonDecode



logging_support.LoggingSupport.initService()

log = getExtendedLogger("webapp-logger")



urls = (
  # Web UI
  "", "DefaultHandler",
  "/", "DefaultHandler",
  "/htm-it", "HTM-ITHandler",
  r"/htm-it/([-\/\w]*)", "HTM-ITHandler",

  # i18n strings
  "/_msgs", "MessagesHandler",

  # REST API Endpoints
  "/_annotations", annotations_api.app,