Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bounded Trie metric type to Python. #33196

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions sdks/python/apache_beam/metrics/cells.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,41 @@ cdef class CounterCell(MetricCell):
cpdef bint update(self, value) except -1


# Not using AbstractMetricCell so that data can be typed.
cdef class DistributionCell(MetricCell):
cdef readonly DistributionData data

@cython.locals(ivalue=libc.stdint.int64_t)
cdef inline bint _update(self, value) except -1


cdef class GaugeCell(MetricCell):
cdef class AbstractMetricCell(MetricCell):
cdef readonly object data_class
cdef readonly object data
cdef bint _update_locked(self, value) except -1


cdef class StringSetCell(MetricCell):
cdef readonly object data
cdef class GaugeCell(AbstractMetricCell):
pass

cdef inline bint _update(self, value) except -1

cdef class StringSetCell(AbstractMetricCell):
pass


cdef class DistributionData(object):
cdef readonly libc.stdint.int64_t sum
cdef readonly libc.stdint.int64_t count
cdef readonly libc.stdint.int64_t min
cdef readonly libc.stdint.int64_t max


cdef class _BoundedTrieNode(object):
cdef readonly libc.stdint.int64_t _size
cdef dict _children
cdef bint _truncated

cdef class BoundedTrieData(object):
cdef readonly libc.stdint.int64_t _bound
cdef readonly object _singleton
cdef readonly _BoundedTrieNode _root
Loading
Loading