Compare commits
7 Commits
0.22.0-cli
...
python-0.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af0125197d | ||
|
|
051453898e | ||
|
|
6047300259 | ||
|
|
84749a2631 | ||
|
|
c0cc5fe6a7 | ||
|
|
b16f7e6ed5 | ||
|
|
9b8045f2ed |
@@ -38,7 +38,7 @@ Steps to deploy a new Data Services API version :
|
|||||||
|
|
||||||
```
|
```
|
||||||
# in dataservices-api repo root path:
|
# in dataservices-api repo root path:
|
||||||
cd server/lib/python/cartodb_services && pip install -r requirements.txt && sudo pip install . --upgrade
|
cd server/lib/python/cartodb_services && sudo pip install -r requirements.txt && sudo pip install . --upgrade
|
||||||
```
|
```
|
||||||
|
|
||||||
- Create a database to hold all the server part and a user for it
|
- Create a database to hold all the server part and a user for it
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ from urlparse import urlparse
|
|||||||
|
|
||||||
|
|
||||||
@contextmanager
|
@contextmanager
|
||||||
def metrics(function, service_config, logger=None):
|
def metrics(function, service_config, logger=None, params=None):
|
||||||
try:
|
try:
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
yield
|
yield
|
||||||
@@ -18,6 +18,7 @@ def metrics(function, service_config, logger=None):
|
|||||||
end_time = time.time()
|
end_time = time.time()
|
||||||
MetricsDataGatherer.add('uuid', str(uuid.uuid1()))
|
MetricsDataGatherer.add('uuid', str(uuid.uuid1()))
|
||||||
MetricsDataGatherer.add('function_name', function)
|
MetricsDataGatherer.add('function_name', function)
|
||||||
|
MetricsDataGatherer.add('function_params', params)
|
||||||
MetricsDataGatherer.add('function_execution_time', (end_time - start_time))
|
MetricsDataGatherer.add('function_execution_time', (end_time - start_time))
|
||||||
metrics_logger = MetricsServiceLoggerFactory.build(service_config,
|
metrics_logger = MetricsServiceLoggerFactory.build(service_config,
|
||||||
logger)
|
logger)
|
||||||
@@ -155,6 +156,7 @@ class MetricsLogger(object):
|
|||||||
"uuid": data.get('uuid', uuid.uuid1()),
|
"uuid": data.get('uuid', uuid.uuid1()),
|
||||||
"type": 'function',
|
"type": 'function',
|
||||||
"function_name": data.get('function_name', None),
|
"function_name": data.get('function_name', None),
|
||||||
|
"function_params": data.get('function_params', None),
|
||||||
"function_execution_time": data.get('function_execution_time',
|
"function_execution_time": data.get('function_execution_time',
|
||||||
None),
|
None),
|
||||||
"service": self._service_config.service_type,
|
"service": self._service_config.service_type,
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ from setuptools import setup, find_packages
|
|||||||
setup(
|
setup(
|
||||||
name='cartodb_services',
|
name='cartodb_services',
|
||||||
|
|
||||||
version='0.15.6',
|
version='0.15.7',
|
||||||
|
|
||||||
description='CartoDB Services API Python Library',
|
description='CartoDB Services API Python Library',
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user