diff --git a/src/ralph/assets/api/serializers.py b/src/ralph/assets/api/serializers.py index e4732b02d8..0713a2e666 100644 --- a/src/ralph/assets/api/serializers.py +++ b/src/ralph/assets/api/serializers.py @@ -381,7 +381,7 @@ class Meta: class ProcessorSimpleSerializer(RalphAPISerializer): class Meta: model = Processor - fields = ('id', 'url', 'speed', 'cores') + fields = ('id', 'url', 'speed', 'cores', 'logical_cores') class ProcessorSerializer(ProcessorSimpleSerializer): diff --git a/src/ralph/assets/migrations/0034_auto_20240304_1511.py b/src/ralph/assets/migrations/0034_auto_20240304_1511.py new file mode 100644 index 0000000000..4a0e2241fd --- /dev/null +++ b/src/ralph/assets/migrations/0034_auto_20240304_1511.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('assets', '0033_auto_20211115_1125'), + ] + + operations = [ + migrations.AddField( + model_name='processor', + name='logical_cores', + field=models.PositiveIntegerField(blank=True, null=True), + ), + migrations.AlterField( + model_name='processor', + name='cores', + field=models.PositiveIntegerField(verbose_name='physical cores', blank=True, null=True), + ), + ] diff --git a/src/ralph/assets/models/components.py b/src/ralph/assets/models/components.py index 69aa597d33..58efabe015 100644 --- a/src/ralph/assets/models/components.py +++ b/src/ralph/assets/models/components.py @@ -221,7 +221,10 @@ class Processor(Component): speed = models.PositiveIntegerField( verbose_name=_("speed (MHz)"), null=True, blank=True, ) - cores = models.PositiveIntegerField(null=True, blank=True) + cores = models.PositiveIntegerField( + verbose_name="physical cores", null=True, blank=True + ) + logical_cores = models.PositiveIntegerField(null=True, blank=True) class Meta: verbose_name = _('processor') diff --git a/src/ralph/assets/views.py b/src/ralph/assets/views.py index 3059748e7f..b869aeefe8 100644 --- a/src/ralph/assets/views.py +++ b/src/ralph/assets/views.py @@ -39,6 +39,7 @@ class ProcessorInline(RalphTabularInline): 'model_name', 'speed', 'cores', + 'logical_cores' ) extra = 1