mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-23 18:04:34 +00:00
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)
|
||||
|
||||
|
||||
{'name': 'Monitoring: Statsd Metrics',
|
||||
'version': '12.0.1.0.0',
|
||||
'version': '13.0.1.0.0',
|
||||
'author': 'Camptocamp,Odoo Community Association (OCA)',
|
||||
'license': 'AGPL-3',
|
||||
'category': 'category',
|
||||
@@ -16,5 +16,5 @@
|
||||
'external_dependencies': {
|
||||
'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)
|
||||
|
||||
from odoo import models
|
||||
@@ -13,11 +13,11 @@ class IrHttp(models.AbstractModel):
|
||||
@classmethod
|
||||
def _dispatch(cls):
|
||||
if not statsd:
|
||||
return super(IrHttp, cls)._dispatch()
|
||||
return super()._dispatch()
|
||||
|
||||
path_info = request.httprequest.environ.get('PATH_INFO')
|
||||
if path_info.startswith('/longpolling/'):
|
||||
return super(IrHttp, cls)._dispatch()
|
||||
return super()._dispatch()
|
||||
|
||||
parts = ['http', ]
|
||||
if path_info.startswith('/web/dataset/call_button'):
|
||||
@@ -38,4 +38,4 @@ class IrHttp(models.AbstractModel):
|
||||
]
|
||||
|
||||
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 os
|
||||
|
||||
Reference in New Issue
Block a user