tally icon indicating copy to clipboard operation
tally copied to clipboard

Adding NoopScope, TestScope and Sanitizer

Open ravirajj opened this issue 6 years ago • 4 comments

This pull request contains the following commits to bring uber-java/tally on par with uber-go/tally:

  • Upgrade to Java 8 (previous attempt #39)
    • enable the use of static interface methods to hide implementation classes.
    • remove synchronized statements and enable the use of ConcurrentMap.putIfAbsent.
  • Only exposing public interfaces, implementations are package-private:
    • Moving BucketPairImpl.bucketPairs() to BucketPairs.create().
  • Adding NoopScope (previous attempt #40), NullStatsReporter
  • Adding TestScope interface and factory methods
  • Adding Sanitizer interface and implementation

ravirajj avatar Sep 07 '19 22:09 ravirajj

Repeats the features from

https://github.com/uber-java/tally/pull/39 https://github.com/uber-java/tally/pull/40

JigarJoshi avatar Sep 09 '19 18:09 JigarJoshi

Only exposing public interfaces, implementations are package-private.

This is unfortunately probably backwards incompatible, and I'm not sure worth a new version. Should we back that out? cc @prateek

andrewmains12 avatar Sep 09 '19 18:09 andrewmains12

Only exposing public interfaces, implementations are package-private.

This is unfortunately probably backwards incompatible, and I'm not sure worth a new version. Should we back that out? cc @prateek

The main change here is moving BucketPairImpl. bucketPairs() to BucketPairs.create(), since Java 8 allows you to add static methods to interfaces. Alternatively, we can add BucketPairFactory.createbucketPairs() if we are using Java 7 and hide the *Impl classes.

ravirajj avatar Sep 09 '19 18:09 ravirajj

Repeats the features from #39 Plus other changes to make Travis pass! #40 Different Implementation. This implementation uses NullStatsReporter just like uber-go/tally: https://github.com/uber-go/tally/blob/master/scope.go#L32

ravirajj avatar Sep 09 '19 19:09 ravirajj