[ 
https://issues.apache.org/jira/browse/IMPALA-15088?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18090153#comment-18090153
 ] 

Aleksandr Efimov commented on IMPALA-15088:
-------------------------------------------

Uploaded a patch for review:
http://gerrit.cloudera.org:8080/24485

The patch adds ReadOnlyIntGauge as a common read-only interface for integer
gauge metrics and updates the read-only metric consumers to use it.

Validation:
- git diff --check
- python3 bin/jenkins/critique-gerrit-review.py --dryrun
- focused Linux build: make java
- focused Linux build: make unified-be-test-executable
- focused Linux backend test: MetricsTest.* (46 tests passed)

> Improve interoperability of IntGauge and FunctionGauge for read-only code
> -------------------------------------------------------------------------
>
>                 Key: IMPALA-15088
>                 URL: https://issues.apache.org/jira/browse/IMPALA-15088
>             Project: IMPALA
>          Issue Type: Improvement
>          Components: Backend
>    Affects Versions: Impala 5.0.0
>            Reporter: Joe McDonnell
>            Assignee: Aleksandr Efimov
>            Priority: Major
>
> The IntGauge type is an alias for AtomicMetric<TMetricKind::GAUGE>, which has 
> an atomic int64_t that can be updated. However, we also use IntGauge for many 
> other things that are read only. Here are some examples:
>  * MemTracker can take an IntGauge consumption metric to integrate it into 
> the MemTracker hierarchy (e.g. tcmalloc overhead)
>  * SumGauge reads multiple IntGauges and returns the sum
>  * NegatedGauge reads a single IntGauge and negates it
>  * Memory metrics override IntGauge but get the values from gperftools 
> MallocExtension (or other equivalents)
> These are read only uses of IntGauge or situations where the IntGauge behaves 
> more like a FunctionGauge. Since FunctionGauge doesn't inherit from IntGauge, 
> it makes it hard to use FunctionGauge with any of these pieces of code.
> Since these are all read-only uses, it might make sense to create a 
> ReadOnlyIntGauge alias that is the base class of FunctionGauge and IntGauge. 
> i.e.
> {noformat}
> using ReadOnlyIntGauge = ScalarMetric<int64_t, TMetricKind::GAUGE>;{noformat}
> Read only uses work properly with this base class, and it makes it possible 
> for IntGauges and FunctionGauges to interoperate with this code.
> This would be very useful for the memory metrics. In particular, the derived 
> metric classes like TotalBytesReservedMetric or the OverheadBytesMetric from 
> the MallocUtil change would be unnecessary if they could be expressed as 
> FunctionGauges.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to