diff --git a/README.md b/README.md index cca501671175017b26e01072842b5db2ce521234..af8b42b1d34895bfd07c5cb8bcb2e24096b0ab20 100644 --- a/README.md +++ b/README.md @@ -166,6 +166,7 @@ Next change the version in the following places: # Release Notes +* 0.32.4 Fixed polling period (from 2500s to 2.5s). * 0.32.3 Fixed disappeared metrics from LOFARDevice, OPCUADevice, StationManager. * 0.32.2 Change hardware_powered_R to hardware_powered_fraction_R to report partial power. Implemented hardware_powered_fraction_R for more devices. diff --git a/tangostationcontrol/VERSION b/tangostationcontrol/VERSION index d721c76847ae6c55ef9718236f47c0df61860c6f..eb7713622c212eb3365e1b66b11d24d72fd84b09 100644 --- a/tangostationcontrol/VERSION +++ b/tangostationcontrol/VERSION @@ -1 +1 @@ -0.32.3 +0.32.4 diff --git a/tangostationcontrol/integration_test/default/devices/test_device_temperature_manager.py b/tangostationcontrol/integration_test/default/devices/test_device_temperature_manager.py index 0d695a028354afbd8d03de98235cef66ed82181d..5dfd4fe8756a73b3cbf61024d41f3a809e6ec9e9 100644 --- a/tangostationcontrol/integration_test/default/devices/test_device_temperature_manager.py +++ b/tangostationcontrol/integration_test/default/devices/test_device_temperature_manager.py @@ -8,7 +8,7 @@ from integration_test.default.devices.base import AbstractTestBases from tango import DeviceProxy, Database, DevState, DevFailed from tangostationcontrol.common.constants import ( - DEFAULT_POLLING_PERIOD, + DEFAULT_POLLING_PERIOD_MS, N_elements, N_pol, N_rcu, @@ -59,7 +59,9 @@ class TestDeviceTemperatureManager(AbstractTestBases.TestDeviceBase): for recvh_name in self.recvh_names: recv_proxy = self.setup_proxy(recvh_name) proxies.append(recv_proxy) - recv_proxy.poll_attribute(self.hbat_led_attribute, DEFAULT_POLLING_PERIOD) + recv_proxy.poll_attribute( + self.hbat_led_attribute, DEFAULT_POLLING_PERIOD_MS + ) self.assertTrue(recv_proxy.is_attribute_polled(self.hbat_led_attribute)) return proxies diff --git a/tangostationcontrol/integration_test/default/devices/test_lofar_device.py b/tangostationcontrol/integration_test/default/devices/test_lofar_device.py index 83ac64acaeb2286924d2379a24b13e659a917949..2852aa73071adb26aab332a37d05da29b034d080 100644 --- a/tangostationcontrol/integration_test/default/devices/test_lofar_device.py +++ b/tangostationcontrol/integration_test/default/devices/test_lofar_device.py @@ -5,7 +5,7 @@ import time from tango import DevState -from tangostationcontrol.common.constants import DEFAULT_POLLING_PERIOD +from tangostationcontrol.common.constants import DEFAULT_POLLING_PERIOD_MS from integration_test import base from integration_test.device_proxy import TestDeviceProxy @@ -28,7 +28,7 @@ class TestProxyAttributeAccess(base.IntegrationTestCase): # make sure the attribute is polled, so we force proxies to access the poll first if self.proxy.is_attribute_polled(self.ATTRIBUTE_NAME): self.proxy.stop_poll_attribute(self.ATTRIBUTE_NAME) - self.proxy.poll_attribute(self.ATTRIBUTE_NAME, DEFAULT_POLLING_PERIOD) + self.proxy.poll_attribute(self.ATTRIBUTE_NAME, DEFAULT_POLLING_PERIOD_MS) def dont_poll_attribute(self): # make sure the attribute is NOT polled, so we force proxies to access the device diff --git a/tangostationcontrol/tangostationcontrol/common/constants.py b/tangostationcontrol/tangostationcontrol/common/constants.py index 45684b65576b69da4972bdc098bfcfe1e3a70451..766c66da9a2700d2bbaf6c7d283540d0219ee697 100644 --- a/tangostationcontrol/tangostationcontrol/common/constants.py +++ b/tangostationcontrol/tangostationcontrol/common/constants.py @@ -103,11 +103,11 @@ MAX_POINTINGS = N_beamlets_max # max size for a statistic packet MAX_ETH_FRAME_SIZE = 9000 -# The default polling period for polled attributes -DEFAULT_POLLING_PERIOD = 1000 +# The default polling period for polled attributes (in milliseconds) +DEFAULT_POLLING_PERIOD_MS = 1000 -# The default polling period for attributes polled to update metrics in Prometheus -DEFAULT_METRICS_POLLING_PERIOD = 2500 +# The default polling period for attributes polled to update metrics in Prometheus (in milliseconds) +DEFAULT_METRICS_POLLING_PERIOD_MS = 2500 # default numer tiles in a HBA for the non-international stations. DEFAULT_N_HBA_TILES = 48 diff --git a/tangostationcontrol/tangostationcontrol/devices/apsct.py b/tangostationcontrol/tangostationcontrol/devices/apsct.py index 7c7c1890e17719bbecdd180ecc221c730636cc84..f1aebc77be3da01e15e65d10f1389c1740fddac0 100644 --- a/tangostationcontrol/tangostationcontrol/devices/apsct.py +++ b/tangostationcontrol/tangostationcontrol/devices/apsct.py @@ -14,7 +14,7 @@ from tango import AttrWriteType # PyTango imports from tango import DebugIt from tango.server import command, attribute, device_property -from tangostationcontrol.common.constants import DEFAULT_POLLING_PERIOD +from tangostationcontrol.common.constants import DEFAULT_POLLING_PERIOD_MS from tangostationcontrol.common.lofar_logging import device_logging_to_python from tangostationcontrol.common.states import DEFAULT_COMMAND_STATES from tangostationcontrol.devices.base_device_classes.opcua_device import OPCUADevice @@ -175,7 +175,7 @@ class APSCT(OPCUADevice): APSCT_TEMP_error_R = attribute( dtype=bool, fisallowed="is_attribute_access_allowed", - polling_period=DEFAULT_POLLING_PERIOD, + polling_period=DEFAULT_POLLING_PERIOD_MS, ) APSCT_VOUT_error_R = attribute(dtype=bool, fisallowed="is_attribute_access_allowed") diff --git a/tangostationcontrol/tangostationcontrol/devices/apspu.py b/tangostationcontrol/tangostationcontrol/devices/apspu.py index b40cf0bef249fd3d894f12b417a71a7cbe515228..8555a314898ef36ec7376eca4bd1a2e05532cbbc 100644 --- a/tangostationcontrol/tangostationcontrol/devices/apspu.py +++ b/tangostationcontrol/tangostationcontrol/devices/apspu.py @@ -12,7 +12,7 @@ from attribute_wrapper.attribute_wrapper import AttributeWrapper from tango import AttrWriteType from tango.server import attribute, device_property -from tangostationcontrol.common.constants import DEFAULT_POLLING_PERIOD +from tangostationcontrol.common.constants import DEFAULT_POLLING_PERIOD_MS from tangostationcontrol.common.lofar_logging import device_logging_to_python from tangostationcontrol.devices.base_device_classes.opcua_device import OPCUADevice from tangostationcontrol.metrics import device_metrics @@ -121,7 +121,7 @@ class APSPU(OPCUADevice): APSPU_TEMP_error_R = attribute( dtype=bool, fisallowed="is_attribute_access_allowed", - polling_period=DEFAULT_POLLING_PERIOD, + polling_period=DEFAULT_POLLING_PERIOD_MS, ) APSPU_VOUT_error_R = attribute(dtype=bool, fisallowed="is_attribute_access_allowed") diff --git a/tangostationcontrol/tangostationcontrol/devices/base_device_classes/lofar_device.py b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/lofar_device.py index 739ac0dca318bd028f55d45d1e58681f33567bef..5f315d2fafead19b22c0a57e50024ab3e54f604d 100644 --- a/tangostationcontrol/tangostationcontrol/devices/base_device_classes/lofar_device.py +++ b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/lofar_device.py @@ -41,8 +41,8 @@ from tangostationcontrol.common.device_decorators import ( DurationMetric, ) from tangostationcontrol.common.constants import ( - DEFAULT_METRICS_POLLING_PERIOD, - DEFAULT_POLLING_PERIOD, + DEFAULT_METRICS_POLLING_PERIOD_MS, + DEFAULT_POLLING_PERIOD_MS, ) from tangostationcontrol.common.events import EventSubscriptions from tangostationcontrol.common.lofar_logging import ( @@ -240,7 +240,7 @@ class LOFARDevice(Device): and self.event_loop_thread.is_running(), # Tango needs to poll this, as otherwise this attribute will never # be exposed as "False" as the event thread must run to do so. - polling_period=DEFAULT_POLLING_PERIOD, + polling_period=DEFAULT_POLLING_PERIOD_MS, ) poll_thread_running_R = attribute( @@ -254,7 +254,7 @@ class LOFARDevice(Device): ), # Tango needs to poll this, as otherwise this attribute will never # be exposed as "False" as the event thread must run to do so. - polling_period=DEFAULT_POLLING_PERIOD, + polling_period=DEFAULT_POLLING_PERIOD_MS, ) # list of translator property names to be set by set_translator_defaults @@ -504,7 +504,7 @@ class LOFARDevice(Device): self.poll_task = PeriodicTask( self.event_loop_thread.event_loop, self.attribute_poller.poll, - DEFAULT_METRICS_POLLING_PERIOD, + DEFAULT_METRICS_POLLING_PERIOD_MS / 1000.0, ) # WARNING: any values read so far are stale. diff --git a/tangostationcontrol/tangostationcontrol/devices/base_device_classes/recv_device.py b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/recv_device.py index fff0279ebe0598c9c518666215625c68126c3b90..88a6b3faeccbc03c90b984aed9d2bd389b32789d 100644 --- a/tangostationcontrol/tangostationcontrol/devices/base_device_classes/recv_device.py +++ b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/recv_device.py @@ -19,7 +19,7 @@ from tango.server import command, device_property, attribute from tangostationcontrol.common.constants import ( N_rcu, N_rcu_inp, - DEFAULT_POLLING_PERIOD, + DEFAULT_POLLING_PERIOD_MS, ) from tangostationcontrol.common.frequency_bands import bands from tangostationcontrol.common.lofar_logging import device_logging_to_python @@ -332,7 +332,7 @@ class RECVDevice(OPCUADevice): dtype=(bool,), max_dim_x=N_rcu, fisallowed="is_attribute_access_allowed", - polling_period=DEFAULT_POLLING_PERIOD, + polling_period=DEFAULT_POLLING_PERIOD_MS, ) RECV_VOUT_error_R = attribute( dtype=(bool,), max_dim_x=N_rcu, fisallowed="is_attribute_access_allowed" diff --git a/tangostationcontrol/tangostationcontrol/devices/ccd.py b/tangostationcontrol/tangostationcontrol/devices/ccd.py index 9aecfc11fbfa24a095e7ed8516bdc326b04d2511..4b53c3e53010ff5356a4c073c373792c7ec0e2b3 100644 --- a/tangostationcontrol/tangostationcontrol/devices/ccd.py +++ b/tangostationcontrol/tangostationcontrol/devices/ccd.py @@ -14,7 +14,7 @@ from tango import AttrWriteType # PyTango imports from tango import DebugIt from tango.server import command, attribute, device_property -from tangostationcontrol.common.constants import DEFAULT_POLLING_PERIOD +from tangostationcontrol.common.constants import DEFAULT_POLLING_PERIOD_MS from tangostationcontrol.common.lofar_logging import device_logging_to_python from tangostationcontrol.common.states import DEFAULT_COMMAND_STATES from tangostationcontrol.devices.base_device_classes.opcua_device import OPCUADevice @@ -164,7 +164,7 @@ class CCD(OPCUADevice): CCD_TEMP_error_R = attribute( dtype=bool, fisallowed="is_attribute_access_allowed", - polling_period=DEFAULT_POLLING_PERIOD, + polling_period=DEFAULT_POLLING_PERIOD_MS, ) CCD_VOUT_error_R = attribute(dtype=bool, fisallowed="is_attribute_access_allowed") diff --git a/tangostationcontrol/tangostationcontrol/devices/observation_field.py b/tangostationcontrol/tangostationcontrol/devices/observation_field.py index 6c8253d5a95d376650844a4c355d485691c18e8e..36949e49d56ddf4240b4a6174f97af43cabbbaa1 100644 --- a/tangostationcontrol/tangostationcontrol/devices/observation_field.py +++ b/tangostationcontrol/tangostationcontrol/devices/observation_field.py @@ -15,7 +15,7 @@ from jsonschema.exceptions import ValidationError from tango import AttrWriteType, DeviceProxy, DevState, Util from tango.server import attribute from tangostationcontrol.common.constants import ( - DEFAULT_POLLING_PERIOD, + DEFAULT_POLLING_PERIOD_MS, MAX_ANTENNA, MAX_PARALLEL_SUBBANDS, N_beamlets_ctrl, @@ -66,8 +66,8 @@ class ObservationField(LOFARDevice): @attribute( doc="Return a value that changes over time, to check if the device is alive.", dtype=numpy.float64, - polling_period=DEFAULT_POLLING_PERIOD, - period=str(DEFAULT_POLLING_PERIOD), + polling_period=DEFAULT_POLLING_PERIOD_MS, + period=str(DEFAULT_POLLING_PERIOD_MS), rel_change="1.0", ) def alive_R(self): diff --git a/tangostationcontrol/tangostationcontrol/devices/sdp/firmware.py b/tangostationcontrol/tangostationcontrol/devices/sdp/firmware.py index fb136f35d1cae485bbdbb7d1a1bbf7eaa42368ac..0bbdb1f2403718438324b0ab33719de8931cb0ca 100644 --- a/tangostationcontrol/tangostationcontrol/devices/sdp/firmware.py +++ b/tangostationcontrol/tangostationcontrol/devices/sdp/firmware.py @@ -22,7 +22,7 @@ from tangostationcontrol.common.constants import ( CLK_200_MHZ, CLK_160_MHZ, N_subbands, - DEFAULT_POLLING_PERIOD, + DEFAULT_POLLING_PERIOD_MS, ) from tangostationcontrol.common.lofar_logging import device_logging_to_python from tangostationcontrol.devices.base_device_classes.opcua_device import OPCUADevice @@ -132,7 +132,7 @@ class SDPFirmware(OPCUADevice): datatype=numpy.int32, dims=(N_pn,), doc="Active FPGA image (0=factory, 1=user)", - polling_period=DEFAULT_POLLING_PERIOD, + polling_period=DEFAULT_POLLING_PERIOD_MS, abs_change="1", ) FPGA_boot_image_RW = AttributeWrapper( @@ -273,7 +273,7 @@ class SDPFirmware(OPCUADevice): dtype=numpy.uint32, access=AttrWriteType.READ_WRITE, fisallowed="is_attribute_access_allowed", - polling_period=DEFAULT_POLLING_PERIOD, + polling_period=DEFAULT_POLLING_PERIOD_MS, abs_change="1", ) diff --git a/tangostationcontrol/tangostationcontrol/devices/sdp/sdp.py b/tangostationcontrol/tangostationcontrol/devices/sdp/sdp.py index 76f0c0df9ee2d27d5fb744939c4d56fa0ec08351..ee6fc00b4f345541e23a4697f153be82a6084a48 100644 --- a/tangostationcontrol/tangostationcontrol/devices/sdp/sdp.py +++ b/tangostationcontrol/tangostationcontrol/devices/sdp/sdp.py @@ -21,7 +21,7 @@ from tangostationcontrol.common.constants import ( N_subband_res, N_subbands, DEFAULT_SUBBAND, - DEFAULT_POLLING_PERIOD, + DEFAULT_POLLING_PERIOD_MS, SDP_UNIT_WEIGHT, ) from tangostationcontrol.common.lofar_logging import device_logging_to_python @@ -450,7 +450,7 @@ class SDP(OPCUADevice): max_dim_x=S_pn, access=AttrWriteType.READ_WRITE, fisallowed="is_attribute_access_allowed", - polling_period=DEFAULT_POLLING_PERIOD, + polling_period=DEFAULT_POLLING_PERIOD_MS, abs_change="1", ) subband_frequency_R = attribute( @@ -460,7 +460,7 @@ class SDP(OPCUADevice): max_dim_y=N_pn * S_pn, max_dim_x=N_subbands, fisallowed="is_attribute_access_allowed", - polling_period=DEFAULT_POLLING_PERIOD, + polling_period=DEFAULT_POLLING_PERIOD_MS, abs_change="1.0", ) diff --git a/tangostationcontrol/tangostationcontrol/devices/temperature_manager.py b/tangostationcontrol/tangostationcontrol/devices/temperature_manager.py index cb4c8db03eea5ca4a2905a05df04d5b74a43faa4..c0d8152600871ba0bcf73f786ce58f01c63e7183 100644 --- a/tangostationcontrol/tangostationcontrol/devices/temperature_manager.py +++ b/tangostationcontrol/tangostationcontrol/devices/temperature_manager.py @@ -20,7 +20,7 @@ from tango.server import command # Additional import from tangostationcontrol.common.case_insensitive_dict import CaseInsensitiveDict -from tangostationcontrol.common.constants import DEFAULT_POLLING_PERIOD +from tangostationcontrol.common.constants import DEFAULT_POLLING_PERIOD_MS from tangostationcontrol.common.lofar_logging import ( device_logging_to_python, log_exceptions, @@ -139,7 +139,7 @@ class TemperatureManager(LOFARDevice): is_alarming_R = attribute( dtype=bool, - polling_period=DEFAULT_POLLING_PERIOD, + polling_period=DEFAULT_POLLING_PERIOD_MS, fisallowed="is_attribute_access_allowed", ) diff --git a/tangostationcontrol/tangostationcontrol/devices/unb2.py b/tangostationcontrol/tangostationcontrol/devices/unb2.py index 85d7e4de354acdab7998440a5263382229d3b61d..2da85760f1de6b66168fb1d2907519233994d88d 100644 --- a/tangostationcontrol/tangostationcontrol/devices/unb2.py +++ b/tangostationcontrol/tangostationcontrol/devices/unb2.py @@ -16,7 +16,7 @@ from tangostationcontrol.common.constants import ( N_fpga, N_ddr, N_qsfp, - DEFAULT_POLLING_PERIOD, + DEFAULT_POLLING_PERIOD_MS, ) from tangostationcontrol.common.lofar_logging import device_logging_to_python from tangostationcontrol.common.states import DEFAULT_COMMAND_STATES @@ -368,7 +368,7 @@ class UNB2(OPCUADevice): dtype=(bool,), max_dim_x=N_unb, fisallowed="is_attribute_access_allowed", - polling_period=DEFAULT_POLLING_PERIOD, + polling_period=DEFAULT_POLLING_PERIOD_MS, ) UNB2_VOUT_error_R = attribute( dtype=(bool,), max_dim_x=N_unb, fisallowed="is_attribute_access_allowed"