[ https://issues.apache.org/jira/browse/BEAM-4374?focusedWorklogId=414848&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-414848 ]
ASF GitHub Bot logged work on BEAM-4374: ---------------------------------------- Author: ASF GitHub Bot Created on: 02/Apr/20 16:55 Start Date: 02/Apr/20 16:55 Worklog Time Spent: 10m Work Description: lukecwik commented on pull request #11286: [BEAM-4374] Short IDs for the Python SDK URL: https://github.com/apache/beam/pull/11286#discussion_r402463213 ########## File path: sdks/python/apache_beam/runners/worker/sdk_worker.py ########## @@ -76,6 +79,50 @@ DEFAULT_BUNDLE_PROCESSOR_CACHE_SHUTDOWN_THRESHOLD_S = 60 +class ShortIdCache(object): + """ Cache for MonitoringInfo "short ids" + """ + def __init__(self): + self._lock = threading.Lock() + self._lastShortId = 0 + self._infoKeyToShortId = {} # type: Dict[FrozenSet, str] + self._shortIdToInfo = {} # type: Dict[str, metrics_pb2.MonitoringInfo] + + def getShortId(self, monitoring_info): + """ Returns the assigned shortId for a given MonitoringInfo, assigns one if + not assigned already. + """ + # type: (metrics_pb2.MonitoringInfo) -> str + with self._lock: + key = monitoring_infos.to_key(monitoring_info) Review comment: ```suggestion key = monitoring_infos.to_key(monitoring_info) with self._lock: ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 414848) Time Spent: 37h 10m (was: 37h) > Update existing metrics in the FN API to use new Metric Schema > -------------------------------------------------------------- > > Key: BEAM-4374 > URL: https://issues.apache.org/jira/browse/BEAM-4374 > Project: Beam > Issue Type: New Feature > Components: beam-model > Reporter: Alex Amato > Priority: Major > Time Spent: 37h 10m > Remaining Estimate: 0h > > Update existing metrics to use the new proto and cataloging schema defined in: > [_https://s.apache.org/beam-fn-api-metrics_] > * Check in new protos > * Define catalog file for metrics > * Port existing metrics to use this new format, based on catalog > names+metadata -- This message was sent by Atlassian Jira (v8.3.4#803005)