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

ASF subversion and git services commented on GEODE-7010:
--------------------------------------------------------

Commit b49279477a4c79b90220fb34239d12c2d9e50782 in geode's branch 
refs/heads/develop from Kirk Lund
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=b492794 ]

GEODE-7010: Replace static globals in CachePerfStats with StatisticsClock 
(#3859)

* Replace CachePerfStats.getStatTime with Cache owned StatisticsClock
* Inject StatisticsClock dependency via constructor


> Replace static globals in CachePerfStats with StatisticsClock
> -------------------------------------------------------------
>
>                 Key: GEODE-7010
>                 URL: https://issues.apache.org/jira/browse/GEODE-7010
>             Project: Geode
>          Issue Type: Wish
>          Components: statistics
>            Reporter: Kirk Lund
>            Assignee: Kirk Lund
>            Priority: Major
>          Time Spent: 2h 50m
>  Remaining Estimate: 0h
>
> Introduce new StatisticsClock interface. An instance will be created during 
> Cache creation. The method isEnabled() will be configured by 
> system.getConfig().getEnableTimeStatistics() and getTime() will return 
> System.nanoTime() if enabled or zero if disabled. This instance will be 
> passed around and injected as a dependency via the constructor of each class 
> that uses it.
> {noformat}
> @FunctionalInterface
> public interface StatisticsClock {
>   /**
>    * Returns the current value of the running Java Virtual Machine's 
> high-resolution time source,
>    * in nanoseconds.
>    *
>    * <p>
>    * See {@code java.lang.System#nanoTime()}.
>    */
>   long getTime();
>   /**
>    * Returns true if this clock is enabled. If disabled then {@code 
> getTime()} will return zero.
>    *
>    * <p>
>    * Default returns {@code true}.
>    */
>   default boolean isEnabled() {
>     return true;
>   }
> }
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to