Skip to content

Commit a735bc5

Browse files
authored
Merge pull request #82 from digital-asset/python-metrics-1.0
python: Remove the block offset metric, as it is no longer numeric in DAML SDK 1.0
2 parents ba5b8a4 + 6e047dd commit a735bc5

File tree

4 files changed

+6
-12
lines changed

4 files changed

+6
-12
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.7.3
1+
6.7.4

python/dazl/metrics/prometheus.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,9 @@ def __init__(self, registry: 'Optional[CollectorRegistry]' = None):
3636
'dazl_network_loop_responsiveness_seconds',
3737
'Number of seconds to immediately schedule and execute a no-op on the event loop',
3838
registry=registry)
39-
self._offset = Gauge(
40-
'dazl_party_offset',
41-
'current read offset',
42-
['party'],
43-
registry=registry)
4439

4540
def loop_responsiveness(self, responsiveness: 'timedelta') -> None:
4641
self._loop_responsiveness_seconds.set(responsiveness.total_seconds())
4742

4843
def party_offset(self, party: 'Party', offset: str) -> None:
49-
if offset is not None:
50-
self._offset.labels(party).set(offset)
44+
pass

python/dazl/model/reading.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,14 +317,14 @@ def max_offset(offsets: 'Collection[str]') -> 'Optional[str]':
317317
return max(offsets, key=sortable_offset_height) if offsets else None
318318

319319

320-
def sortable_offset_height(value: str) -> 'Union[int, str]':
320+
def sortable_offset_height(value: str) -> 'str':
321321
if value:
322322
try:
323323
components = value.split('-', 3)
324324
if len(components) == 1:
325-
return int(value)
325+
return f'{int(value):016d}'
326326
elif len(components) >= 1:
327-
return int(components[1])
327+
return f'{int(components[1]):016d}'
328328
except ValueError:
329329
# newer versions of the DAML SDK no longer return offsets in a parseable format, but
330330
# the strings themselves are naturally comparable

python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "dazl"
3-
version = "6.7.3"
3+
version = "6.7.4"
44
description = "high-level Ledger API client for DAML ledgers"
55
license = "Apache-2.0"
66
authors = ["Davin K. Tanabe <davin.tanabe@digitalasset.com>"]

0 commit comments

Comments
 (0)