Fix Prometheus Plugin syntax error
Creating PM job was failed because there are mismatch about spelling, regular expression and prometheus rule expression. This patch fixes this problem. Closes-Bug: #1990828 Change-Id: Iae0e85361b8c3759621849a72e9b82fd2fe278ed
This commit is contained in:
@@ -260,7 +260,7 @@ The following are the parameters required by this interface.
|
|||||||
* ``performanceMetric`` and ``performanceMetricGroup``, at least one of
|
* ``performanceMetric`` and ``performanceMetricGroup``, at least one of
|
||||||
the two attributes shall be present.
|
the two attributes shall be present.
|
||||||
* ``objectType`` has only the following values: ``Vnf``, ``Vnfc``,
|
* ``objectType`` has only the following values: ``Vnf``, ``Vnfc``,
|
||||||
``VnfIntCP``, ``VnfExtCP``.
|
``VnfIntCp``, ``VnfExtCp``.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -284,7 +284,7 @@ as follows:
|
|||||||
"VcpuUsageMeanVnf.495ffedf-2755-42c8-bf14-a5433701311e"
|
"VcpuUsageMeanVnf.495ffedf-2755-42c8-bf14-a5433701311e"
|
||||||
],
|
],
|
||||||
"performanceMetricGroup": [
|
"performanceMetricGroup": [
|
||||||
"VirtualizedComputeResource"
|
"VirtualisedComputeResource"
|
||||||
],
|
],
|
||||||
"collectionPeriod": 5,
|
"collectionPeriod": 5,
|
||||||
"reportingPeriod": 10,
|
"reportingPeriod": 10,
|
||||||
|
@@ -58,7 +58,7 @@ Alert = {
|
|||||||
'annotations': {
|
'annotations': {
|
||||||
'type': 'object',
|
'type': 'object',
|
||||||
'properties': {
|
'properties': {
|
||||||
'value': {'type': 'number'},
|
'value': {'type': ['number', 'string']},
|
||||||
'probable_cause': {'type': 'string'},
|
'probable_cause': {'type': 'string'},
|
||||||
'fault_type': {'type': 'string'},
|
'fault_type': {'type': 'string'},
|
||||||
'fault_details': {'type': 'string'}
|
'fault_details': {'type': 'string'}
|
||||||
|
@@ -51,8 +51,8 @@ CreatePmJobRequest_V210 = {
|
|||||||
# the types can be extended.
|
# the types can be extended.
|
||||||
'Vnf',
|
'Vnf',
|
||||||
'Vnfc',
|
'Vnfc',
|
||||||
'VnfIntCP',
|
'VnfIntCp',
|
||||||
'VnfExtCP']
|
'VnfExtCp']
|
||||||
},
|
},
|
||||||
'objectInstanceIds': {
|
'objectInstanceIds': {
|
||||||
'type': 'array',
|
'type': 'array',
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
|
import itertools
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import paramiko
|
import paramiko
|
||||||
@@ -78,10 +79,10 @@ class PrometheusPluginPm(PrometheusPlugin, mon_base.MonitoringPlugin):
|
|||||||
self.sol_exp_map = {
|
self.sol_exp_map = {
|
||||||
'VCpuUsageMeanVnf':
|
'VCpuUsageMeanVnf':
|
||||||
'avg(sum(rate(pod_cpu_usage_seconds_total'
|
'avg(sum(rate(pod_cpu_usage_seconds_total'
|
||||||
'{{pod=~"{pod}"}}[{reporting_period}s]))',
|
'{{pod=~"{pod}"}}[{reporting_period}s])))',
|
||||||
'VCpuUsagePeakVnf':
|
'VCpuUsagePeakVnf':
|
||||||
'max(sum(rate(pod_cpu_usage_seconds_total'
|
'max(sum(rate(pod_cpu_usage_seconds_total'
|
||||||
'{{pod=~"{pod}"}}[{reporting_period}s]))',
|
'{{pod=~"{pod}"}}[{reporting_period}s])))',
|
||||||
'VMemoryUsageMeanVnf':
|
'VMemoryUsageMeanVnf':
|
||||||
'avg(pod_memory_working_set_bytes{{pod=~"{pod}"}} / '
|
'avg(pod_memory_working_set_bytes{{pod=~"{pod}"}} / '
|
||||||
'on(pod) (kube_node_status_capacity{{resource="memory"}} * '
|
'on(pod) (kube_node_status_capacity{{resource="memory"}} * '
|
||||||
@@ -93,11 +94,11 @@ class PrometheusPluginPm(PrometheusPlugin, mon_base.MonitoringPlugin):
|
|||||||
'VDiskUsageMeanVnf':
|
'VDiskUsageMeanVnf':
|
||||||
'avg(container_fs_usage_bytes{{container="{container}",'
|
'avg(container_fs_usage_bytes{{container="{container}",'
|
||||||
'pod=~"{pod}"}}/container_fs_limit_bytes{{container='
|
'pod=~"{pod}"}}/container_fs_limit_bytes{{container='
|
||||||
'"{container}",pod=~"{pod}"}}))',
|
'"{container}",pod=~"{pod}"}})',
|
||||||
'VDiskUsagePeakVnf':
|
'VDiskUsagePeakVnf':
|
||||||
'max(container_fs_usage_bytes{{container="{container}",'
|
'max(container_fs_usage_bytes{{container="{container}",'
|
||||||
'pod=~"{pod}"}}/container_fs_limit_bytes{{container='
|
'pod=~"{pod}"}}/container_fs_limit_bytes{{container='
|
||||||
'"{container}",pod=~"{pod}"}}))',
|
'"{container}",pod=~"{pod}"}})',
|
||||||
'ByteIncomingVnfIntCp':
|
'ByteIncomingVnfIntCp':
|
||||||
'sum(container_network_receive_bytes_total'
|
'sum(container_network_receive_bytes_total'
|
||||||
'{{interface="{sub_object_instance_id}",pod=~"{pod}"}})',
|
'{{interface="{sub_object_instance_id}",pod=~"{pod}"}})',
|
||||||
@@ -164,6 +165,8 @@ class PrometheusPluginPm(PrometheusPlugin, mon_base.MonitoringPlugin):
|
|||||||
if not report:
|
if not report:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
report = list(map(lambda x: x.entries, report))
|
||||||
|
report = list(itertools.chain.from_iterable(report))
|
||||||
entries_of_same_object = list(
|
entries_of_same_object = list(
|
||||||
filter(
|
filter(
|
||||||
lambda x: (
|
lambda x: (
|
||||||
@@ -171,7 +174,7 @@ class PrometheusPluginPm(PrometheusPlugin, mon_base.MonitoringPlugin):
|
|||||||
(not x.obj_attr_is_set('subObjectInstanceId') or
|
(not x.obj_attr_is_set('subObjectInstanceId') or
|
||||||
x.subObjectInstanceId == sub_object_instance_id) and
|
x.subObjectInstanceId == sub_object_instance_id) and
|
||||||
x.performanceMetric == metric),
|
x.performanceMetric == metric),
|
||||||
report.entries))
|
report))
|
||||||
if len(entries_of_same_object) == 0:
|
if len(entries_of_same_object) == 0:
|
||||||
return None
|
return None
|
||||||
values = sum(list(map(
|
values = sum(list(map(
|
||||||
@@ -283,7 +286,7 @@ class PrometheusPluginPm(PrometheusPlugin, mon_base.MonitoringPlugin):
|
|||||||
pm_job.criteria.performanceMetricGroup) else []
|
pm_job.criteria.performanceMetricGroup) else []
|
||||||
for obj in pm_job.objectInstanceIds:
|
for obj in pm_job.objectInstanceIds:
|
||||||
for grp in metric_grps:
|
for grp in metric_grps:
|
||||||
if grp == 'VirtualizedComputeResource':
|
if grp == 'VirtualisedComputeResource':
|
||||||
metrics.append(f'VCpuUsageMeanVnf.{obj}')
|
metrics.append(f'VCpuUsageMeanVnf.{obj}')
|
||||||
metrics.append(f'VCpuUsagePeakVnf.{obj}')
|
metrics.append(f'VCpuUsagePeakVnf.{obj}')
|
||||||
metrics.append(f'VMemoryUsageMeanVnf.{obj}')
|
metrics.append(f'VMemoryUsageMeanVnf.{obj}')
|
||||||
@@ -346,8 +349,8 @@ class PrometheusPluginPm(PrometheusPlugin, mon_base.MonitoringPlugin):
|
|||||||
# ['test-test1-756757f8f-xcwmt',
|
# ['test-test1-756757f8f-xcwmt',
|
||||||
# 'test-test2-756757f8f-kmghr', ...]
|
# 'test-test2-756757f8f-kmghr', ...]
|
||||||
# convert them to a regex string such as:
|
# convert them to a regex string such as:
|
||||||
# '(test\-test1\-[0-9a-f]{1,10}-[0-9a-z]{5}$|
|
# '(test-test1-[0-9a-f]{1,10}-[0-9a-z]{5}$|
|
||||||
# test\-test2\-[0-9a-f]{1,10}-[0-9a-z]{5}$|...)'
|
# test-test2-[0-9a-f]{1,10}-[0-9a-z]{5}$|...)'
|
||||||
deployments = list(filter(
|
deployments = list(filter(
|
||||||
lambda r:
|
lambda r:
|
||||||
r.computeResource.obj_attr_is_set(
|
r.computeResource.obj_attr_is_set(
|
||||||
@@ -359,10 +362,10 @@ class PrometheusPluginPm(PrometheusPlugin, mon_base.MonitoringPlugin):
|
|||||||
'Deployment', resource_info
|
'Deployment', resource_info
|
||||||
))
|
))
|
||||||
deployments = list(set(list(map(
|
deployments = list(set(list(map(
|
||||||
lambda d: re.escape(re.sub(
|
lambda d: re.sub(
|
||||||
r'\-[0-9a-f]{1,10}-[0-9a-z]{5}$', '',
|
r'\-[0-9a-f]{1,10}\-[0-9a-z]{5}$', '',
|
||||||
d.computeResource.resourceId)) +
|
d.computeResource.resourceId) +
|
||||||
r'\-[0-9a-f]{1,10}-[0-9a-z]{5}$',
|
r'-[0-9a-f]{1,10}-[0-9a-z]{5}$',
|
||||||
deployments
|
deployments
|
||||||
))))
|
))))
|
||||||
pods_regexp = '(' + '|'.join(deployments) + ')'
|
pods_regexp = '(' + '|'.join(deployments) + ')'
|
||||||
@@ -379,8 +382,8 @@ class PrometheusPluginPm(PrometheusPlugin, mon_base.MonitoringPlugin):
|
|||||||
# ['test-test1-756757f8f-xcwmt',
|
# ['test-test1-756757f8f-xcwmt',
|
||||||
# 'test-test2-756757f8f-kmghr', ...]
|
# 'test-test2-756757f8f-kmghr', ...]
|
||||||
# convert them to a regex string such as:
|
# convert them to a regex string such as:
|
||||||
# '(test\-test1\-[0-9a-f]{1,10}-[0-9a-z]{5}$|
|
# '(test-test1-[0-9a-f]{1,10}-[0-9a-z]{5}$|
|
||||||
# test\-test2\-[0-9a-f]{1,10}-[0-9a-z]{5}$|...)'
|
# test-test2-[0-9a-f]{1,10}-[0-9a-z]{5}$|...)'
|
||||||
resource_info = self.get_vnfc_resource_info(context, obj, inst_map)
|
resource_info = self.get_vnfc_resource_info(context, obj, inst_map)
|
||||||
if not resource_info:
|
if not resource_info:
|
||||||
continue
|
continue
|
||||||
@@ -443,12 +446,11 @@ class PrometheusPluginPm(PrometheusPlugin, mon_base.MonitoringPlugin):
|
|||||||
continue
|
continue
|
||||||
resource_id = compute_resource.resourceId
|
resource_id = compute_resource.resourceId
|
||||||
deployment = re.sub(
|
deployment = re.sub(
|
||||||
r'\-[0-9a-f]{1,10}-[0-9a-z]{5}$', '', resource_id)
|
r'\-[0-9a-f]{1,10}\-[0-9a-z]{5}$', '', resource_id)
|
||||||
g = re.match(r'^(.+)\-\1{1,}[0-9]+', deployment)
|
g = re.match(r'^(.+)\-\1{1,}[0-9]+', deployment)
|
||||||
if not g:
|
if not g:
|
||||||
continue
|
continue
|
||||||
container = g.group(1)
|
container = g.group(1)
|
||||||
resource_id = re.escape(resource_id)
|
|
||||||
expr = self.make_prom_ql(
|
expr = self.make_prom_ql(
|
||||||
target, resource_id, container=container,
|
target, resource_id, container=container,
|
||||||
collection_period=collection_period,
|
collection_period=collection_period,
|
||||||
|
@@ -40,8 +40,8 @@ CONF = config.CONF
|
|||||||
OBJ_TYPE_TO_GROUP_TYPE = {
|
OBJ_TYPE_TO_GROUP_TYPE = {
|
||||||
'Vnf': 'VirtualisedComputeResource',
|
'Vnf': 'VirtualisedComputeResource',
|
||||||
'Vnfc': 'VirtualisedComputeResource',
|
'Vnfc': 'VirtualisedComputeResource',
|
||||||
'VnfIntCP': 'VnfInternalCP',
|
'VnfIntCp': 'VnfInternalCp',
|
||||||
'VnfExtCP': 'VnfExternalCP'
|
'VnfExtCp': 'VnfExternalCp'
|
||||||
}
|
}
|
||||||
|
|
||||||
OBJ_TYPE_TO_METRIC_LISt = {
|
OBJ_TYPE_TO_METRIC_LISt = {
|
||||||
@@ -51,9 +51,9 @@ OBJ_TYPE_TO_METRIC_LISt = {
|
|||||||
'Vnfc': {'VCpuUsageMeanVnf', 'VCpuUsagePeakVnf',
|
'Vnfc': {'VCpuUsageMeanVnf', 'VCpuUsagePeakVnf',
|
||||||
'VMemoryUsageMeanVnf', 'VMemoryUsagePeakVnf',
|
'VMemoryUsageMeanVnf', 'VMemoryUsagePeakVnf',
|
||||||
'VDiskUsageMeanVnf', 'VDiskUsagePeakVnf'},
|
'VDiskUsageMeanVnf', 'VDiskUsagePeakVnf'},
|
||||||
'VnfIntCP': {'ByteIncomingVnfIntCp', 'ByteOutgoingVnfIntCp',
|
'VnfIntCp': {'ByteIncomingVnfIntCp', 'ByteOutgoingVnfIntCp',
|
||||||
'PacketIncomingVnfIntCp', 'PacketOutgoingVnfIntCp'},
|
'PacketIncomingVnfIntCp', 'PacketOutgoingVnfIntCp'},
|
||||||
'VnfExtCP': {'ByteIncomingVnfExtCp', 'ByteOutgoingVnfExtCp',
|
'VnfExtCp': {'ByteIncomingVnfExtCp', 'ByteOutgoingVnfExtCp',
|
||||||
'PacketIncomingVnfExtCp', 'PacketOutgoingVnfExtCp'}
|
'PacketIncomingVnfExtCp', 'PacketOutgoingVnfExtCp'}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -62,7 +62,7 @@ _body_pm_alert1 = {
|
|||||||
'object_instance_id': '25b9b9d0-2461-4109-866e-a7767375415b'
|
'object_instance_id': '25b9b9d0-2461-4109-866e-a7767375415b'
|
||||||
},
|
},
|
||||||
'annotations': {
|
'annotations': {
|
||||||
'value': 99,
|
'value': '99',
|
||||||
},
|
},
|
||||||
'startsAt': '2022-06-21T23:47:36.453Z',
|
'startsAt': '2022-06-21T23:47:36.453Z',
|
||||||
'endsAt': '0001-01-01T00:00:00Z',
|
'endsAt': '0001-01-01T00:00:00Z',
|
||||||
@@ -110,7 +110,7 @@ _pm_job = {
|
|||||||
'VcpuUsageMeanVnf.25b9b9d0-2461-4109-866e-a7767375415b'
|
'VcpuUsageMeanVnf.25b9b9d0-2461-4109-866e-a7767375415b'
|
||||||
],
|
],
|
||||||
'performanceMetricGroup': [
|
'performanceMetricGroup': [
|
||||||
'VirtualizedComputeResource',
|
'VirtualisedComputeResource',
|
||||||
'InvalidGroupName'
|
'InvalidGroupName'
|
||||||
],
|
],
|
||||||
'collectionPeriod': 15,
|
'collectionPeriod': 15,
|
||||||
@@ -331,8 +331,8 @@ class TestPrometheusPluginPm(base.TestCase):
|
|||||||
self.config_fixture.config(
|
self.config_fixture.config(
|
||||||
group='prometheus_plugin', performance_management=True)
|
group='prometheus_plugin', performance_management=True)
|
||||||
mock_pm_job.return_value = objects.PmJobV2.from_dict(_pm_job)
|
mock_pm_job.return_value = objects.PmJobV2.from_dict(_pm_job)
|
||||||
mock_pm_report.return_value = objects.PerformanceReportV2.from_dict(
|
mock_pm_report.return_value = [objects.PerformanceReportV2.from_dict(
|
||||||
_pm_report)
|
_pm_report)]
|
||||||
pp = mon_base.MonitoringPlugin.get_instance(
|
pp = mon_base.MonitoringPlugin.get_instance(
|
||||||
prometheus_plugin.PrometheusPluginPm)
|
prometheus_plugin.PrometheusPluginPm)
|
||||||
|
|
||||||
@@ -350,8 +350,8 @@ class TestPrometheusPluginPm(base.TestCase):
|
|||||||
self.config_fixture.config(
|
self.config_fixture.config(
|
||||||
group='prometheus_plugin', performance_management=True)
|
group='prometheus_plugin', performance_management=True)
|
||||||
mock_pm_job.return_value = objects.PmJobV2.from_dict(_pm_job)
|
mock_pm_job.return_value = objects.PmJobV2.from_dict(_pm_job)
|
||||||
mock_pm_report.return_value = objects.PerformanceReportV2.from_dict(
|
mock_pm_report.return_value = [objects.PerformanceReportV2.from_dict(
|
||||||
_pm_report)
|
_pm_report)]
|
||||||
pp = mon_base.MonitoringPlugin.get_instance(
|
pp = mon_base.MonitoringPlugin.get_instance(
|
||||||
prometheus_plugin.PrometheusPluginPm)
|
prometheus_plugin.PrometheusPluginPm)
|
||||||
unload_uuidsentinel()
|
unload_uuidsentinel()
|
||||||
@@ -367,8 +367,8 @@ class TestPrometheusPluginPm(base.TestCase):
|
|||||||
self.config_fixture.config(
|
self.config_fixture.config(
|
||||||
group='prometheus_plugin', performance_management=True)
|
group='prometheus_plugin', performance_management=True)
|
||||||
mock_pm_job.return_value = objects.PmJobV2.from_dict(_pm_job)
|
mock_pm_job.return_value = objects.PmJobV2.from_dict(_pm_job)
|
||||||
mock_pm_report.return_value = objects.PerformanceReportV2.from_dict(
|
mock_pm_report.return_value = [objects.PerformanceReportV2.from_dict(
|
||||||
_pm_report2)
|
_pm_report2)]
|
||||||
pp = mon_base.MonitoringPlugin.get_instance(
|
pp = mon_base.MonitoringPlugin.get_instance(
|
||||||
prometheus_plugin.PrometheusPluginPm)
|
prometheus_plugin.PrometheusPluginPm)
|
||||||
unload_uuidsentinel()
|
unload_uuidsentinel()
|
||||||
@@ -393,8 +393,8 @@ class TestPrometheusPluginPm(base.TestCase):
|
|||||||
self.config_fixture.config(
|
self.config_fixture.config(
|
||||||
group='prometheus_plugin', performance_management=True)
|
group='prometheus_plugin', performance_management=True)
|
||||||
mock_pm_job.return_value = objects.PmJobV2.from_dict(_pm_job)
|
mock_pm_job.return_value = objects.PmJobV2.from_dict(_pm_job)
|
||||||
mock_pm_report.return_value = objects.PerformanceReportV2.from_dict(
|
mock_pm_report.return_value = [objects.PerformanceReportV2.from_dict(
|
||||||
_pm_report)
|
_pm_report)]
|
||||||
pp = mon_base.MonitoringPlugin.get_instance(
|
pp = mon_base.MonitoringPlugin.get_instance(
|
||||||
prometheus_plugin.PrometheusPluginPm)
|
prometheus_plugin.PrometheusPluginPm)
|
||||||
unload_uuidsentinel()
|
unload_uuidsentinel()
|
||||||
@@ -417,8 +417,8 @@ class TestPrometheusPluginPm(base.TestCase):
|
|||||||
self.config_fixture.config(
|
self.config_fixture.config(
|
||||||
group='prometheus_plugin', performance_management=True)
|
group='prometheus_plugin', performance_management=True)
|
||||||
mock_pm_job.return_value = objects.PmJobV2.from_dict(_pm_job)
|
mock_pm_job.return_value = objects.PmJobV2.from_dict(_pm_job)
|
||||||
mock_pm_report.return_value = objects.PerformanceReportV2.from_dict(
|
mock_pm_report.return_value = [objects.PerformanceReportV2.from_dict(
|
||||||
_pm_report)
|
_pm_report)]
|
||||||
pp = mon_base.MonitoringPlugin.get_instance(
|
pp = mon_base.MonitoringPlugin.get_instance(
|
||||||
prometheus_plugin.PrometheusPluginPm)
|
prometheus_plugin.PrometheusPluginPm)
|
||||||
pp.set_callback(None)
|
pp.set_callback(None)
|
||||||
@@ -487,7 +487,7 @@ class TestPrometheusPluginPm(base.TestCase):
|
|||||||
group='prometheus_plugin', performance_management=True)
|
group='prometheus_plugin', performance_management=True)
|
||||||
pp = mon_base.MonitoringPlugin.get_instance(
|
pp = mon_base.MonitoringPlugin.get_instance(
|
||||||
prometheus_plugin.PrometheusPluginPm)
|
prometheus_plugin.PrometheusPluginPm)
|
||||||
# VirtualizedComputeResource
|
# VirtualisedComputeResource
|
||||||
job = objects.PmJobV2.from_dict(_pm_job)
|
job = objects.PmJobV2.from_dict(_pm_job)
|
||||||
rule = pp.create_job(context=self.context, pm_job=job)
|
rule = pp.create_job(context=self.context, pm_job=job)
|
||||||
self.assertTrue(len(rule['groups'][0]['rules']) > 0)
|
self.assertTrue(len(rule['groups'][0]['rules']) > 0)
|
||||||
@@ -515,7 +515,7 @@ class TestPrometheusPluginPm(base.TestCase):
|
|||||||
group='prometheus_plugin', performance_management=True)
|
group='prometheus_plugin', performance_management=True)
|
||||||
pp = mon_base.MonitoringPlugin.get_instance(
|
pp = mon_base.MonitoringPlugin.get_instance(
|
||||||
prometheus_plugin.PrometheusPluginPm)
|
prometheus_plugin.PrometheusPluginPm)
|
||||||
# VirtualizedComputeResource
|
# VirtualisedComputeResource
|
||||||
job = copy.deepcopy(_pm_job)
|
job = copy.deepcopy(_pm_job)
|
||||||
job['subObjectInstanceIds'] = ['vnfc_info1']
|
job['subObjectInstanceIds'] = ['vnfc_info1']
|
||||||
job = objects.PmJobV2.from_dict(job)
|
job = objects.PmJobV2.from_dict(job)
|
||||||
@@ -638,7 +638,7 @@ class TestPrometheusPluginPm(base.TestCase):
|
|||||||
pp.create_job, context=self.context, pm_job=job
|
pp.create_job, context=self.context, pm_job=job
|
||||||
)
|
)
|
||||||
|
|
||||||
# resourcename mismatch: VirtualizedComputeResource
|
# resourcename mismatch: VirtualisedComputeResource
|
||||||
ins = copy.deepcopy(_inst1)
|
ins = copy.deepcopy(_inst1)
|
||||||
_ = ins['instantiatedVnfInfo']['vnfcResourceInfo']
|
_ = ins['instantiatedVnfInfo']['vnfcResourceInfo']
|
||||||
del _[0]['computeResource']['resourceId']
|
del _[0]['computeResource']['resourceId']
|
||||||
@@ -650,7 +650,7 @@ class TestPrometheusPluginPm(base.TestCase):
|
|||||||
sol_ex.PrometheusPluginError,
|
sol_ex.PrometheusPluginError,
|
||||||
pp.create_job, context=self.context, pm_job=job
|
pp.create_job, context=self.context, pm_job=job
|
||||||
)
|
)
|
||||||
# resourcename mismatch: VirtualizedComputeResource
|
# resourcename mismatch: VirtualisedComputeResource
|
||||||
ins = copy.deepcopy(_inst1)
|
ins = copy.deepcopy(_inst1)
|
||||||
_ = ins['instantiatedVnfInfo']['vnfcResourceInfo'][0]
|
_ = ins['instantiatedVnfInfo']['vnfcResourceInfo'][0]
|
||||||
_['computeResource']['resourceId'] = 'test-xxx1-756757f8f-xcwmt'
|
_['computeResource']['resourceId'] = 'test-xxx1-756757f8f-xcwmt'
|
||||||
|
@@ -100,7 +100,7 @@ class TestVnfpmV2(base.BaseTestCase):
|
|||||||
vnfpm_v2._check_performance_metric_or_group,
|
vnfpm_v2._check_performance_metric_or_group,
|
||||||
obj_type='Vnf',
|
obj_type='Vnf',
|
||||||
metric_group=['VirtualisedComputeResource',
|
metric_group=['VirtualisedComputeResource',
|
||||||
'VnfInternalCP'],
|
'VnfInternalCp'],
|
||||||
performance_metric=['VCpuUsageMeanVnf.VNF'])
|
performance_metric=['VCpuUsageMeanVnf.VNF'])
|
||||||
|
|
||||||
self.assertRaises(sol_ex.PMJobInvalidRequest,
|
self.assertRaises(sol_ex.PMJobInvalidRequest,
|
||||||
|
Reference in New Issue
Block a user