Skip to content

Commit c4a0be5

Browse files
author
Alex Balgavy
committed
Remove sdls_get_stats
Based on feedback, it does not currently provide any benefits.
1 parent 6d542f9 commit c4a0be5

6 files changed

Lines changed: 443 additions & 510 deletions

File tree

yamcs-client/src/yamcs/client/links/client.py

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import functools
2-
from typing import Any, Callable, Dict, Iterable, Mapping, Optional
2+
from typing import Any, Callable, Dict, Mapping, Optional
33

44
from google.protobuf import json_format, struct_pb2
55
from yamcs.client.core.context import Context
66
from yamcs.client.core.futures import WebSocketSubscriptionFuture
77
from yamcs.client.core.subscriptions import WebSocketSubscriptionManager
8-
from yamcs.client.links.model import Cop1Config, Cop1Status, SdlsStats
8+
from yamcs.client.links.model import Cop1Config, Cop1Status
99
from yamcs.client.model import Link
1010
from yamcs.protobuf.cop1 import cop1_pb2
1111
from yamcs.protobuf.links import links_pb2
@@ -232,9 +232,7 @@ def get_cop1_status(self) -> Cop1Status:
232232
message.ParseFromString(response.content)
233233
return Cop1Status(message)
234234

235-
def create_cop1_subscription(
236-
self, on_data: Callable[[Cop1Status], None], timeout: float = 60
237-
) -> Cop1Subscription:
235+
def create_cop1_subscription(self, on_data: Callable[[Cop1Status], None], timeout: float = 60) -> Cop1Subscription:
238236
"""
239237
Create a new subscription for receiving status of the COP1 link.
240238
@@ -258,9 +256,7 @@ def create_cop1_subscription(
258256
# Represent subscription as a future
259257
subscription = Cop1Subscription(manager)
260258

261-
wrapped_callback = functools.partial(
262-
_wrap_callback_parse_cop1_status, subscription, on_data
263-
)
259+
wrapped_callback = functools.partial(_wrap_callback_parse_cop1_status, subscription, on_data)
264260

265261
manager.open(wrapped_callback)
266262

@@ -284,23 +280,6 @@ def sdls_reset_ctr(self, spi: int):
284280
"""
285281
self.ctx.delete_proto(f"/sdls/{self._instance}/{self._link}/{spi}/seq")
286282

287-
def sdls_get_stats(self) -> Iterable[SdlsStats]:
288-
"""
289-
Get statistics for all `spi`s (Security Parameter Indices) on this link.
290-
"""
291-
response = self.ctx.get_proto(f"/sdls/{self._instance}/stats")
292-
message = sdls_pb2.GetStatsResponse()
293-
message.ParseFromString(response.content)
294-
stats = getattr(message, "stats")
295-
link_stats = []
296-
297-
for stat in stats:
298-
parsed_stat = SdlsStats(stat)
299-
if parsed_stat.link_name == self._link:
300-
link_stats.append(parsed_stat)
301-
302-
return iter(link_stats)
303-
304283
def sdls_set_key(self, spi: int, key: bytes):
305284
"""
306285
Update the `key` associated with a given `spi` (Security Parameter Index) on this link.

yamcs-client/src/yamcs/client/links/model.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -87,24 +87,3 @@ def __str__(self):
8787
res = f"VC_ID: {self.vc_id}, win: {self.window_width}"
8888
res += f", timeout_type: {self.timeout_type}"
8989
return res + f", tx_limit: {self.tx_limit}, t1: {self.t1}"
90-
91-
92-
class SdlsStats:
93-
def __init__(self, proto):
94-
self._proto = proto
95-
96-
@property
97-
def instance(self) -> str:
98-
return self._proto.instance
99-
100-
@property
101-
def link_name(self) -> str:
102-
return self._proto.linkName
103-
104-
@property
105-
def spi(self) -> int:
106-
return self._proto.spi
107-
108-
@property
109-
def seq(self) -> int:
110-
return self._proto.seqCtr

yamcs-client/src/yamcs/protobuf/mdb/mdb_pb2.py

Lines changed: 271 additions & 176 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

yamcs-client/src/yamcs/protobuf/processing/processing_pb2.py

Lines changed: 48 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

yamcs-client/src/yamcs/protobuf/sdls/sdls_pb2.py

Lines changed: 12 additions & 161 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)