Skip to content
Snippets Groups Projects
Commit ff41bd86 authored by Jan David Mol's avatar Jan David Mol
Browse files

Merge branch 'fix-polling-period' into 'master'

Polling periods are in milliseconds. Made this more explicit.

See merge request !897
parents 949832cb 3c116bc8
No related branches found
No related tags found
1 merge request!897Polling periods are in milliseconds. Made this more explicit.
Showing
with 38 additions and 35 deletions
...@@ -166,6 +166,7 @@ Next change the version in the following places: ...@@ -166,6 +166,7 @@ Next change the version in the following places:
# Release Notes # 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.3 Fixed disappeared metrics from LOFARDevice, OPCUADevice, StationManager.
* 0.32.2 Change hardware_powered_R to hardware_powered_fraction_R to report partial power. * 0.32.2 Change hardware_powered_R to hardware_powered_fraction_R to report partial power.
Implemented hardware_powered_fraction_R for more devices. Implemented hardware_powered_fraction_R for more devices.
......
0.32.3 0.32.4
...@@ -8,7 +8,7 @@ from integration_test.default.devices.base import AbstractTestBases ...@@ -8,7 +8,7 @@ from integration_test.default.devices.base import AbstractTestBases
from tango import DeviceProxy, Database, DevState, DevFailed from tango import DeviceProxy, Database, DevState, DevFailed
from tangostationcontrol.common.constants import ( from tangostationcontrol.common.constants import (
DEFAULT_POLLING_PERIOD, DEFAULT_POLLING_PERIOD_MS,
N_elements, N_elements,
N_pol, N_pol,
N_rcu, N_rcu,
...@@ -59,7 +59,9 @@ class TestDeviceTemperatureManager(AbstractTestBases.TestDeviceBase): ...@@ -59,7 +59,9 @@ class TestDeviceTemperatureManager(AbstractTestBases.TestDeviceBase):
for recvh_name in self.recvh_names: for recvh_name in self.recvh_names:
recv_proxy = self.setup_proxy(recvh_name) recv_proxy = self.setup_proxy(recvh_name)
proxies.append(recv_proxy) 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)) self.assertTrue(recv_proxy.is_attribute_polled(self.hbat_led_attribute))
return proxies return proxies
......
...@@ -5,7 +5,7 @@ import time ...@@ -5,7 +5,7 @@ import time
from tango import DevState 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 import base
from integration_test.device_proxy import TestDeviceProxy from integration_test.device_proxy import TestDeviceProxy
...@@ -28,7 +28,7 @@ class TestProxyAttributeAccess(base.IntegrationTestCase): ...@@ -28,7 +28,7 @@ class TestProxyAttributeAccess(base.IntegrationTestCase):
# make sure the attribute is polled, so we force proxies to access the poll first # make sure the attribute is polled, so we force proxies to access the poll first
if self.proxy.is_attribute_polled(self.ATTRIBUTE_NAME): if self.proxy.is_attribute_polled(self.ATTRIBUTE_NAME):
self.proxy.stop_poll_attribute(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): def dont_poll_attribute(self):
# make sure the attribute is NOT polled, so we force proxies to access the device # make sure the attribute is NOT polled, so we force proxies to access the device
......
...@@ -103,11 +103,11 @@ MAX_POINTINGS = N_beamlets_max ...@@ -103,11 +103,11 @@ MAX_POINTINGS = N_beamlets_max
# max size for a statistic packet # max size for a statistic packet
MAX_ETH_FRAME_SIZE = 9000 MAX_ETH_FRAME_SIZE = 9000
# The default polling period for polled attributes # The default polling period for polled attributes (in milliseconds)
DEFAULT_POLLING_PERIOD = 1000 DEFAULT_POLLING_PERIOD_MS = 1000
# The default polling period for attributes polled to update metrics in Prometheus # The default polling period for attributes polled to update metrics in Prometheus (in milliseconds)
DEFAULT_METRICS_POLLING_PERIOD = 2500 DEFAULT_METRICS_POLLING_PERIOD_MS = 2500
# default numer tiles in a HBA for the non-international stations. # default numer tiles in a HBA for the non-international stations.
DEFAULT_N_HBA_TILES = 48 DEFAULT_N_HBA_TILES = 48
......
...@@ -14,7 +14,7 @@ from tango import AttrWriteType ...@@ -14,7 +14,7 @@ from tango import AttrWriteType
# PyTango imports # PyTango imports
from tango import DebugIt from tango import DebugIt
from tango.server import command, attribute, device_property 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.lofar_logging import device_logging_to_python
from tangostationcontrol.common.states import DEFAULT_COMMAND_STATES from tangostationcontrol.common.states import DEFAULT_COMMAND_STATES
from tangostationcontrol.devices.base_device_classes.opcua_device import OPCUADevice from tangostationcontrol.devices.base_device_classes.opcua_device import OPCUADevice
...@@ -175,7 +175,7 @@ class APSCT(OPCUADevice): ...@@ -175,7 +175,7 @@ class APSCT(OPCUADevice):
APSCT_TEMP_error_R = attribute( APSCT_TEMP_error_R = attribute(
dtype=bool, dtype=bool,
fisallowed="is_attribute_access_allowed", 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") APSCT_VOUT_error_R = attribute(dtype=bool, fisallowed="is_attribute_access_allowed")
......
...@@ -12,7 +12,7 @@ from attribute_wrapper.attribute_wrapper import AttributeWrapper ...@@ -12,7 +12,7 @@ from attribute_wrapper.attribute_wrapper import AttributeWrapper
from tango import AttrWriteType from tango import AttrWriteType
from tango.server import attribute, device_property 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.common.lofar_logging import device_logging_to_python
from tangostationcontrol.devices.base_device_classes.opcua_device import OPCUADevice from tangostationcontrol.devices.base_device_classes.opcua_device import OPCUADevice
from tangostationcontrol.metrics import device_metrics from tangostationcontrol.metrics import device_metrics
...@@ -121,7 +121,7 @@ class APSPU(OPCUADevice): ...@@ -121,7 +121,7 @@ class APSPU(OPCUADevice):
APSPU_TEMP_error_R = attribute( APSPU_TEMP_error_R = attribute(
dtype=bool, dtype=bool,
fisallowed="is_attribute_access_allowed", 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") APSPU_VOUT_error_R = attribute(dtype=bool, fisallowed="is_attribute_access_allowed")
......
...@@ -41,8 +41,8 @@ from tangostationcontrol.common.device_decorators import ( ...@@ -41,8 +41,8 @@ from tangostationcontrol.common.device_decorators import (
DurationMetric, DurationMetric,
) )
from tangostationcontrol.common.constants import ( from tangostationcontrol.common.constants import (
DEFAULT_METRICS_POLLING_PERIOD, DEFAULT_METRICS_POLLING_PERIOD_MS,
DEFAULT_POLLING_PERIOD, DEFAULT_POLLING_PERIOD_MS,
) )
from tangostationcontrol.common.events import EventSubscriptions from tangostationcontrol.common.events import EventSubscriptions
from tangostationcontrol.common.lofar_logging import ( from tangostationcontrol.common.lofar_logging import (
...@@ -240,7 +240,7 @@ class LOFARDevice(Device): ...@@ -240,7 +240,7 @@ class LOFARDevice(Device):
and self.event_loop_thread.is_running(), and self.event_loop_thread.is_running(),
# Tango needs to poll this, as otherwise this attribute will never # Tango needs to poll this, as otherwise this attribute will never
# be exposed as "False" as the event thread must run to do so. # 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( poll_thread_running_R = attribute(
...@@ -254,7 +254,7 @@ class LOFARDevice(Device): ...@@ -254,7 +254,7 @@ class LOFARDevice(Device):
), ),
# Tango needs to poll this, as otherwise this attribute will never # Tango needs to poll this, as otherwise this attribute will never
# be exposed as "False" as the event thread must run to do so. # 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 # list of translator property names to be set by set_translator_defaults
...@@ -504,7 +504,7 @@ class LOFARDevice(Device): ...@@ -504,7 +504,7 @@ class LOFARDevice(Device):
self.poll_task = PeriodicTask( self.poll_task = PeriodicTask(
self.event_loop_thread.event_loop, self.event_loop_thread.event_loop,
self.attribute_poller.poll, self.attribute_poller.poll,
DEFAULT_METRICS_POLLING_PERIOD, DEFAULT_METRICS_POLLING_PERIOD_MS / 1000.0,
) )
# WARNING: any values read so far are stale. # WARNING: any values read so far are stale.
......
...@@ -19,7 +19,7 @@ from tango.server import command, device_property, attribute ...@@ -19,7 +19,7 @@ from tango.server import command, device_property, attribute
from tangostationcontrol.common.constants import ( from tangostationcontrol.common.constants import (
N_rcu, N_rcu,
N_rcu_inp, N_rcu_inp,
DEFAULT_POLLING_PERIOD, DEFAULT_POLLING_PERIOD_MS,
) )
from tangostationcontrol.common.frequency_bands import bands from tangostationcontrol.common.frequency_bands import bands
from tangostationcontrol.common.lofar_logging import device_logging_to_python from tangostationcontrol.common.lofar_logging import device_logging_to_python
...@@ -332,7 +332,7 @@ class RECVDevice(OPCUADevice): ...@@ -332,7 +332,7 @@ class RECVDevice(OPCUADevice):
dtype=(bool,), dtype=(bool,),
max_dim_x=N_rcu, max_dim_x=N_rcu,
fisallowed="is_attribute_access_allowed", fisallowed="is_attribute_access_allowed",
polling_period=DEFAULT_POLLING_PERIOD, polling_period=DEFAULT_POLLING_PERIOD_MS,
) )
RECV_VOUT_error_R = attribute( RECV_VOUT_error_R = attribute(
dtype=(bool,), max_dim_x=N_rcu, fisallowed="is_attribute_access_allowed" dtype=(bool,), max_dim_x=N_rcu, fisallowed="is_attribute_access_allowed"
......
...@@ -14,7 +14,7 @@ from tango import AttrWriteType ...@@ -14,7 +14,7 @@ from tango import AttrWriteType
# PyTango imports # PyTango imports
from tango import DebugIt from tango import DebugIt
from tango.server import command, attribute, device_property 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.lofar_logging import device_logging_to_python
from tangostationcontrol.common.states import DEFAULT_COMMAND_STATES from tangostationcontrol.common.states import DEFAULT_COMMAND_STATES
from tangostationcontrol.devices.base_device_classes.opcua_device import OPCUADevice from tangostationcontrol.devices.base_device_classes.opcua_device import OPCUADevice
...@@ -164,7 +164,7 @@ class CCD(OPCUADevice): ...@@ -164,7 +164,7 @@ class CCD(OPCUADevice):
CCD_TEMP_error_R = attribute( CCD_TEMP_error_R = attribute(
dtype=bool, dtype=bool,
fisallowed="is_attribute_access_allowed", 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") CCD_VOUT_error_R = attribute(dtype=bool, fisallowed="is_attribute_access_allowed")
......
...@@ -15,7 +15,7 @@ from jsonschema.exceptions import ValidationError ...@@ -15,7 +15,7 @@ from jsonschema.exceptions import ValidationError
from tango import AttrWriteType, DeviceProxy, DevState, Util from tango import AttrWriteType, DeviceProxy, DevState, Util
from tango.server import attribute from tango.server import attribute
from tangostationcontrol.common.constants import ( from tangostationcontrol.common.constants import (
DEFAULT_POLLING_PERIOD, DEFAULT_POLLING_PERIOD_MS,
MAX_ANTENNA, MAX_ANTENNA,
MAX_PARALLEL_SUBBANDS, MAX_PARALLEL_SUBBANDS,
N_beamlets_ctrl, N_beamlets_ctrl,
...@@ -66,8 +66,8 @@ class ObservationField(LOFARDevice): ...@@ -66,8 +66,8 @@ class ObservationField(LOFARDevice):
@attribute( @attribute(
doc="Return a value that changes over time, to check if the device is alive.", doc="Return a value that changes over time, to check if the device is alive.",
dtype=numpy.float64, dtype=numpy.float64,
polling_period=DEFAULT_POLLING_PERIOD, polling_period=DEFAULT_POLLING_PERIOD_MS,
period=str(DEFAULT_POLLING_PERIOD), period=str(DEFAULT_POLLING_PERIOD_MS),
rel_change="1.0", rel_change="1.0",
) )
def alive_R(self): def alive_R(self):
......
...@@ -22,7 +22,7 @@ from tangostationcontrol.common.constants import ( ...@@ -22,7 +22,7 @@ from tangostationcontrol.common.constants import (
CLK_200_MHZ, CLK_200_MHZ,
CLK_160_MHZ, CLK_160_MHZ,
N_subbands, N_subbands,
DEFAULT_POLLING_PERIOD, DEFAULT_POLLING_PERIOD_MS,
) )
from tangostationcontrol.common.lofar_logging import device_logging_to_python from tangostationcontrol.common.lofar_logging import device_logging_to_python
from tangostationcontrol.devices.base_device_classes.opcua_device import OPCUADevice from tangostationcontrol.devices.base_device_classes.opcua_device import OPCUADevice
...@@ -132,7 +132,7 @@ class SDPFirmware(OPCUADevice): ...@@ -132,7 +132,7 @@ class SDPFirmware(OPCUADevice):
datatype=numpy.int32, datatype=numpy.int32,
dims=(N_pn,), dims=(N_pn,),
doc="Active FPGA image (0=factory, 1=user)", doc="Active FPGA image (0=factory, 1=user)",
polling_period=DEFAULT_POLLING_PERIOD, polling_period=DEFAULT_POLLING_PERIOD_MS,
abs_change="1", abs_change="1",
) )
FPGA_boot_image_RW = AttributeWrapper( FPGA_boot_image_RW = AttributeWrapper(
...@@ -273,7 +273,7 @@ class SDPFirmware(OPCUADevice): ...@@ -273,7 +273,7 @@ class SDPFirmware(OPCUADevice):
dtype=numpy.uint32, dtype=numpy.uint32,
access=AttrWriteType.READ_WRITE, access=AttrWriteType.READ_WRITE,
fisallowed="is_attribute_access_allowed", fisallowed="is_attribute_access_allowed",
polling_period=DEFAULT_POLLING_PERIOD, polling_period=DEFAULT_POLLING_PERIOD_MS,
abs_change="1", abs_change="1",
) )
......
...@@ -21,7 +21,7 @@ from tangostationcontrol.common.constants import ( ...@@ -21,7 +21,7 @@ from tangostationcontrol.common.constants import (
N_subband_res, N_subband_res,
N_subbands, N_subbands,
DEFAULT_SUBBAND, DEFAULT_SUBBAND,
DEFAULT_POLLING_PERIOD, DEFAULT_POLLING_PERIOD_MS,
SDP_UNIT_WEIGHT, SDP_UNIT_WEIGHT,
) )
from tangostationcontrol.common.lofar_logging import device_logging_to_python from tangostationcontrol.common.lofar_logging import device_logging_to_python
...@@ -450,7 +450,7 @@ class SDP(OPCUADevice): ...@@ -450,7 +450,7 @@ class SDP(OPCUADevice):
max_dim_x=S_pn, max_dim_x=S_pn,
access=AttrWriteType.READ_WRITE, access=AttrWriteType.READ_WRITE,
fisallowed="is_attribute_access_allowed", fisallowed="is_attribute_access_allowed",
polling_period=DEFAULT_POLLING_PERIOD, polling_period=DEFAULT_POLLING_PERIOD_MS,
abs_change="1", abs_change="1",
) )
subband_frequency_R = attribute( subband_frequency_R = attribute(
...@@ -460,7 +460,7 @@ class SDP(OPCUADevice): ...@@ -460,7 +460,7 @@ class SDP(OPCUADevice):
max_dim_y=N_pn * S_pn, max_dim_y=N_pn * S_pn,
max_dim_x=N_subbands, max_dim_x=N_subbands,
fisallowed="is_attribute_access_allowed", fisallowed="is_attribute_access_allowed",
polling_period=DEFAULT_POLLING_PERIOD, polling_period=DEFAULT_POLLING_PERIOD_MS,
abs_change="1.0", abs_change="1.0",
) )
......
...@@ -20,7 +20,7 @@ from tango.server import command ...@@ -20,7 +20,7 @@ from tango.server import command
# Additional import # Additional import
from tangostationcontrol.common.case_insensitive_dict import CaseInsensitiveDict 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 ( from tangostationcontrol.common.lofar_logging import (
device_logging_to_python, device_logging_to_python,
log_exceptions, log_exceptions,
...@@ -139,7 +139,7 @@ class TemperatureManager(LOFARDevice): ...@@ -139,7 +139,7 @@ class TemperatureManager(LOFARDevice):
is_alarming_R = attribute( is_alarming_R = attribute(
dtype=bool, dtype=bool,
polling_period=DEFAULT_POLLING_PERIOD, polling_period=DEFAULT_POLLING_PERIOD_MS,
fisallowed="is_attribute_access_allowed", fisallowed="is_attribute_access_allowed",
) )
......
...@@ -16,7 +16,7 @@ from tangostationcontrol.common.constants import ( ...@@ -16,7 +16,7 @@ from tangostationcontrol.common.constants import (
N_fpga, N_fpga,
N_ddr, N_ddr,
N_qsfp, N_qsfp,
DEFAULT_POLLING_PERIOD, DEFAULT_POLLING_PERIOD_MS,
) )
from tangostationcontrol.common.lofar_logging import device_logging_to_python from tangostationcontrol.common.lofar_logging import device_logging_to_python
from tangostationcontrol.common.states import DEFAULT_COMMAND_STATES from tangostationcontrol.common.states import DEFAULT_COMMAND_STATES
...@@ -368,7 +368,7 @@ class UNB2(OPCUADevice): ...@@ -368,7 +368,7 @@ class UNB2(OPCUADevice):
dtype=(bool,), dtype=(bool,),
max_dim_x=N_unb, max_dim_x=N_unb,
fisallowed="is_attribute_access_allowed", fisallowed="is_attribute_access_allowed",
polling_period=DEFAULT_POLLING_PERIOD, polling_period=DEFAULT_POLLING_PERIOD_MS,
) )
UNB2_VOUT_error_R = attribute( UNB2_VOUT_error_R = attribute(
dtype=(bool,), max_dim_x=N_unb, fisallowed="is_attribute_access_allowed" dtype=(bool,), max_dim_x=N_unb, fisallowed="is_attribute_access_allowed"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment