8000 Adding NoopScope, TestScope and Sanitizer by ravirajj · Pull Request #43 · uber-java/tally · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@ravirajj
Copy link
@ravirajj ravirajj commented Sep 7, 2019

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

  • Upgrade to Java 8 (previous attempt Update source&target language level to java8 #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 Noop scope #40), NullStatsReporter
  • Adding TestScope interface and factory methods
  • Adding Sanitizer interface and implementation

@JigarJoshi
Copy link
Contributor

Repeats the features from

#39
#40

@andrewmains12
Copy link
Collaborator

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

@mway mway requested review from justinjc and prateek September 9, 2019 18:18
@ravirajj
Copy link
Author
ravirajj commented Sep 9, 2019

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
Copy link
Author
ravirajj commented Sep 9, 2019

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

@zmanji zmanji mentioned this pull request Dec 18, 2023
SokolAndrey pushed a commit that referenced this pull request Dec 18, 2023
This commit plucks select changes from #69 and #43
to bring uber-java/tally on par with uber-go/tally.

It adds a `TestScope` class which allows users of the library to get a
`Snapshot` of all the metrics emitted by the scope. Users can then assert if
certain metrics were created.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0