-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2cf32f9
Showing
81 changed files
with
7,267 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
# Copyright (c) 2017 Uber Technologies, Inc. | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in | ||
# all copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
# THE SOFTWARE. | ||
|
||
# Based off of https://www.gitignore.io/api/osx,java,intellij,gradle | ||
|
||
### Intellij ### | ||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm | ||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 | ||
|
||
# Intellij: | ||
.idea/* | ||
*.iml | ||
|
||
# Arcanist | ||
.arcconfig | ||
|
||
# CMake | ||
cmake-build-debug/ | ||
|
||
## File-based project format: | ||
*.iws | ||
|
||
## Plugin-specific files: | ||
|
||
# IntelliJ | ||
/out/ | ||
|
||
# JIRA plugin | ||
atlassian-ide-plugin.xml | ||
|
||
# Crashlytics plugin (for Android Studio and IntelliJ) | ||
com_crashlytics_export_strings.xml | ||
crashlytics.properties | ||
crashlytics-build.properties | ||
fabric.properties | ||
|
||
### Intellij Patch ### | ||
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 | ||
|
||
# *.iml | ||
# modules.xml | ||
# *.ipr | ||
|
||
### Java ### | ||
# Compiled class file | ||
*.class | ||
|
||
# Log file | ||
*.log | ||
|
||
# BlueJ files | ||
*.ctxt | ||
|
||
# Mobile Tools for Java (J2ME) | ||
.mtj.tmp/ | ||
|
||
# Package Files # | ||
*.jar | ||
*.war | ||
*.ear | ||
*.zip | ||
*.tar.gz | ||
*.rar | ||
|
||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
hs_err_pid* | ||
|
||
### OSX ### | ||
*.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear in the root of a volume | ||
.DocumentRevisions-V100 | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
.VolumeIcon.icns | ||
.com.apple.timemachine.donotpresent | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
### Gradle ### | ||
.gradle | ||
/**/build/ | ||
|
||
# Ignore Gradle GUI config | ||
gradle-app.setting | ||
|
||
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) | ||
!gradle-wrapper.jar | ||
|
||
# Cache of project | ||
.gradletasknamecache | ||
|
||
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 | ||
# gradle/wrapper/gradle-wrapper.properties | ||
|
||
# End of https://www.gitignore.io/api/osx,java,intellij,gradle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Developer documentation | ||
|
||
This document summarizes information relevant to Java tally contributors. | ||
|
||
## Making code changes | ||
|
||
### Prerequisites | ||
In order to build this project, you must have: | ||
- JDK-7 or later | ||
- Gradle 3.3 or later | ||
|
||
### Building and testing | ||
Gradle is used to build tally. Run this from the top-level directory to build the project: | ||
```sh | ||
./gradlew clean build | ||
``` | ||
|
||
To run the project's tests: | ||
```sh | ||
./gradlew check | ||
``` | ||
|
||
### Making changes | ||
The source code of tally is managed using GitHub, and as such, we use its features to, for example, | ||
track [issues](https://help.github.com/articles/about-issues/) and create | ||
[pull requests](https://help.github.com/articles/creating-a-pull-request/). | ||
|
||
If you have not contributed to the project before, please add your details to the `developers` | ||
section in the top-level [build file](build.gradle). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (c) 2017 Uber Technologies, Inc. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# tally | ||
|
||
Fast, buffered, hierarchical stats collection in Java. [Go here](https://github.com/uber-go/tally) for the Go client. | ||
|
||
## Abstract | ||
|
||
Tally provides a common interface for emitting metrics, while letting you not worry about the velocity of metrics emission. | ||
|
||
By default it buffers counters, gauges and histograms at a specified interval but does not buffer timer values. This is primarily so timer values can have all their values sampled if desired and if not they can be sampled as summaries or histograms independently by a reporter. | ||
|
||
## Structure | ||
|
||
- **Scope**: Keeps track of metrics, and their common metadata. | ||
- **Metrics**: Counters, Gauges, Timers and Histograms. | ||
- **Reporter**: Implemented by you. Accepts aggregated values from the scope. Forwards the aggregated values to your metrics ingestion pipeline. | ||
|
||
### Acquire a Scope | ||
|
||
```java | ||
// Implement as you will | ||
StatsReporter reporter = new MyStatsReporter(); | ||
|
||
Map<String, String> tags = new HashMap<>(2, 1); | ||
tags.put("dc", "east-1"); | ||
tags.put("type", "master"); | ||
|
||
Scope scope = new RootScopeBuilder() | ||
.reporter(reporter) | ||
.tags(tags) | ||
.reportEvery(Duration.ofSeconds(1)) | ||
``` | ||
|
||
### Get/Create a metric; use it | ||
```java | ||
Counter reqCounter = scope.counter("requests"); | ||
reqCounter.inc(1); | ||
|
||
Gauge queueGauge = scope.gauge("queue_length"); | ||
queueGauge.update(42); | ||
``` | ||
|
||
### Report your metrics | ||
|
||
Use one of the inbuilt reporters or implement your own using the `StatsReporter` interface. | ||
|
||
## Example Usage | ||
|
||
Run the example by running: | ||
``` | ||
$ ./gradlew run | ||
``` | ||
This runs the `PrintStatsReporterExample` class in the `tally-example` project. | ||
|
||
## Artifacts Published | ||
|
||
All artifacts are published under the group `com.uber.m3`. | ||
|
||
1. `tally-statsd-fat`: Fat jar version of the tally StatsD reporter | ||
1. `tally-example`: Example usages with different reporters | ||
1. `tally-statsd`: The tally StatsD reporter | ||
1. `tally-core`: tally core functionality that includes interfaces and utilities to report metrics to M3 | ||
|
||
## Versioning | ||
We follow semantic versioning outlined [here](http://semver.org/spec/v2.0.0.html). In summary, | ||
given a version of MAJOR.MINOR.PATCH (e.g. 1.2.0): | ||
|
||
- MAJOR version changes are breaking changes to the public API | ||
- MINOR version changes are backwards-compatible changes that include new functionality | ||
- PATCH version changes are backwards-compatible bug fixes | ||
<hr> | ||
|
||
Released under the [MIT License](LICENSE.md). |
Oops, something went wrong.