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

ASF GitHub Bot commented on FLINK-9210:
---------------------------------------

GitHub user Silven1117 opened a pull request:

    https://github.com/apache/flink/pull/5875

    [FLINK-9210] Removed unnecessary getValue calls in serializeGauge

    ## What is the purpose of the change
    
    * This pull request removes unnecessary gauge.getValue() call in 
MetricDumpSerialization.serializeGauge(). That way gauge value can reset inside 
getValue upon serialization. This allows gauge value to be reset at the time 
metric reporter prepares gauge value for the report.
    
    
    ## Brief change log
    
      - gauge.getValue() gets called only once in 
MetricDumpSerialization.serializeGauge()
    
    
    ## Verifying this change
    
    This change is already covered by existing tests, such as 
MetricDumpSerializerTest.
    
    
    ## Does this pull request potentially affect one of the following parts:
    
      - Dependencies (does it add or upgrade a dependency): no
      - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`:  no
      - The serializers: no(changes live in the MetricDumpSerialization but it 
would not affect)
      - The runtime per-record code paths (performance sensitive): no
      - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Yarn/Mesos, ZooKeeper: no
      - The S3 file system connector: no
    
    ## Documentation
    
      - Does this pull request introduce a new feature? no
      - If yes, how is the feature documented? not applicable


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/Silven1117/flink metric

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/5875.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #5875
    
----
commit 0eb7d7dcd089f0f6a909b1577d662bb1942db192
Author: Jisu You <j0y0149@...>
Date:   2018-04-18T16:23:28Z

    [FLINK-9210] Removed unnecessary getValue call in serializeGauge

----


> Call getValue() only once in gauge serialization
> ------------------------------------------------
>
>                 Key: FLINK-9210
>                 URL: https://issues.apache.org/jira/browse/FLINK-9210
>             Project: Flink
>          Issue Type: Improvement
>          Components: Metrics
>    Affects Versions: 1.4.2
>            Reporter: Jisu You
>            Assignee: Chesnay Schepler
>            Priority: Minor
>             Fix For: 1.5.0, 1.4.3
>
>
> MetricDumpSerialization.serializeGauge() calls gauge.getValue twice in gauge 
> serialization. This is troublesome for those who reset gauges in getValue. 
> serializeGauge() should only call getValue once.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to