mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-24 08:47:40 +00:00
Merge pull request #90 from Tonow-c2c/BSRD-286_MIG-13.0_monitoring_statsd
BSRD-286: MIG V13 monitoring_statsd
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
# Copyright 2016-2018 Camptocamp SA
|
# Copyright 2016-2019 Camptocamp SA
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
||||||
|
|
||||||
|
|
||||||
{'name': 'Monitoring: Statsd Metrics',
|
{'name': 'Monitoring: Statsd Metrics',
|
||||||
'version': '12.0.1.0.0',
|
'version': '13.0.1.0.0',
|
||||||
'author': 'Camptocamp,Odoo Community Association (OCA)',
|
'author': 'Camptocamp,Odoo Community Association (OCA)',
|
||||||
'license': 'AGPL-3',
|
'license': 'AGPL-3',
|
||||||
'category': 'category',
|
'category': 'category',
|
||||||
@@ -16,5 +16,5 @@
|
|||||||
'external_dependencies': {
|
'external_dependencies': {
|
||||||
'python': ['statsd'],
|
'python': ['statsd'],
|
||||||
},
|
},
|
||||||
'installable': False,
|
'installable': True,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright 2016-2018 Camptocamp SA
|
# Copyright 2016-2019 Camptocamp SA
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
||||||
|
|
||||||
from odoo import models
|
from odoo import models
|
||||||
@@ -13,11 +13,11 @@ class IrHttp(models.AbstractModel):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def _dispatch(cls):
|
def _dispatch(cls):
|
||||||
if not statsd:
|
if not statsd:
|
||||||
return super(IrHttp, cls)._dispatch()
|
return super()._dispatch()
|
||||||
|
|
||||||
path_info = request.httprequest.environ.get('PATH_INFO')
|
path_info = request.httprequest.environ.get('PATH_INFO')
|
||||||
if path_info.startswith('/longpolling/'):
|
if path_info.startswith('/longpolling/'):
|
||||||
return super(IrHttp, cls)._dispatch()
|
return super()._dispatch()
|
||||||
|
|
||||||
parts = ['http', ]
|
parts = ['http', ]
|
||||||
if path_info.startswith('/web/dataset/call_button'):
|
if path_info.startswith('/web/dataset/call_button'):
|
||||||
@@ -38,4 +38,4 @@ class IrHttp(models.AbstractModel):
|
|||||||
]
|
]
|
||||||
|
|
||||||
with statsd.timer('.'.join(parts)):
|
with statsd.timer('.'.join(parts)):
|
||||||
return super(IrHttp, cls)._dispatch()
|
return super()._dispatch()
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# Copyright 2016-2019 Camptocamp SA
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
|||||||
Reference in New Issue
Block a user