Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This syncs the internal view to the OSS view. Author: @sprsquish Fixes #372 URL: #372
- Loading branch information
Showing
43 changed files
with
581 additions
and
2 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,17 @@ | ||
name := "my-collector" | ||
|
||
organization := "com.twitter" | ||
|
||
scalaVersion := "2.9.2" | ||
|
||
libraryDependencies ++= Seq( | ||
"com.twitter" % "zipkin-cassandra" % "1.2.0-SNAPSHOT", | ||
"com.twitter" % "zipkin-collector" % "1.2.0-SNAPSHOT", | ||
"com.twitter" % "zipkin-receiver-scribe" % "1.2.0-SNAPSHOT", | ||
"com.twitter" %% "twitter-server" % "1.4.1") | ||
|
||
resolvers ++= Seq( | ||
"twitter.com" at "http://maven.twttr.com/", | ||
"maven" at "http://repo1.maven.org/maven2/", | ||
"freemarker" at "http://freemarker.sourceforge.net/maven2/", | ||
"local" at ("file:" + System.getProperty("user.home") + "/.m2/repository/")) |
30 changes: 30 additions & 0 deletions
30
doc/examples/collector/src/main/scala/com/twitter/my-collector/MyCollectorService.scala
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,30 @@ | ||
package com.twitter.mycollector | ||
|
||
import com.twitter.finagle.stats.StatsReceiver | ||
import com.twitter.server.TwitterServer | ||
import com.twitter.util.{Await, Future} | ||
import com.twitter.zipkin.cassandra.CassieSpanStoreFactory | ||
import com.twitter.zipkin.collector.{SpanReceiver, ZipkinQueuedCollectorFactory} | ||
import com.twitter.zipkin.common.Span | ||
import com.twitter.zipkin.receiver.scribe.ScribeSpanReceiverFactory | ||
import com.twitter.zipkin.storage.WriteSpanStore | ||
import com.twitter.zipkin.zookeeper.ZooKeeperClientFactory | ||
|
||
object ZipkinCollectorServer extends TwitterServer | ||
with ZipkinQueuedCollectorFactory | ||
with CassieSpanStoreFactory | ||
with ZooKeeperClientFactory | ||
with ScribeSpanReceiverFactory | ||
{ | ||
def newReceiver(receive: Seq[Span] => Future[Unit], stats: StatsReceiver): SpanReceiver = | ||
newScribeSpanReceiver(receive, stats.scope("scribeSpanReceiver")) | ||
|
||
def newSpanStore(stats: StatsReceiver): WriteSpanStore = | ||
newCassandraStore(stats.scope("cassie")) | ||
|
||
def main() { | ||
val collector = newCollector(statsReceiver) | ||
onExit { collector.close() } | ||
Await.ready(collector) | ||
} | ||
} |
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,13 @@ | ||
maven_layout() | ||
|
||
jar_library(name='zipkin-cassandra', | ||
dependencies=[ | ||
pants('oss/zipkin-cassandra/src/main/scala') | ||
] | ||
) | ||
|
||
jar_library(name='tests', | ||
dependencies=[ | ||
pants('oss/zipkin-cassandra/src/test/scala') | ||
] | ||
) |
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,13 @@ | ||
scala_library(name='scala', | ||
dependencies=[ | ||
pants('3rdparty:cassie-core'), | ||
pants('3rdparty:cassie-serversets'), | ||
pants('3rdparty:finagle-serversets'), | ||
pants('3rdparty:util-app'), | ||
pants('3rdparty:util-logging'), | ||
pants('3rdparty:scrooge-serializer'), | ||
pants('3rdparty:snappy'), | ||
pants('oss/zipkin-scrooge'), | ||
], | ||
sources=rglobs('*.scala') | ||
) |
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,15 @@ | ||
junit_tests(name='scala', | ||
dependencies=[ | ||
pants('3rdparty:junit'), | ||
pants('3rdparty:scalatest'), | ||
pants('3rdparty:mockito-all'), | ||
pants('3rdparty:hamcrest-all'), | ||
pants('3rdparty:objenesis'), | ||
pants('3rdparty:jmock'), | ||
pants('3rdparty:asm'), | ||
pants('3rdparty:cglib'), | ||
pants('3rdparty:specs'), | ||
pants('oss/zipkin-cassandra'), | ||
], | ||
sources=rglobs('*.scala'), | ||
) |
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,13 @@ | ||
maven_layout() | ||
|
||
jar_library(name='zipkin-collector-core', | ||
dependencies=[ | ||
pants('oss/zipkin-collector-core/src/main/scala'), | ||
] | ||
) | ||
|
||
jar_library(name='tests', | ||
dependencies=[ | ||
pants('oss/zipkin-collector-core/src/test/scala') | ||
] | ||
) |
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,14 @@ | ||
scala_library(name='scala', | ||
dependencies=[ | ||
pants('3rdparty:finagle-exception'), | ||
pants('3rdparty:finagle-ostrich4'), | ||
pants('3rdparty:finagle-serversets'), | ||
pants('3rdparty:finagle-zipkin'), | ||
pants('3rdparty:util-core'), | ||
pants('3rdparty:util-zk'), | ||
pants('oss/zipkin-common'), | ||
pants('oss/zipkin-scrooge'), | ||
pants('oss/zipkin-zookeeper'), | ||
], | ||
sources=rglobs('*.scala'), | ||
) |
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,15 @@ | ||
scala_tests(name='scala', | ||
dependencies=[ | ||
pants('3rdparty:junit'), | ||
pants('3rdparty:scalatest'), | ||
pants('3rdparty:mockito-all'), | ||
pants('3rdparty:hamcrest-all'), | ||
pants('3rdparty:objenesis'), | ||
pants('3rdparty:jmock'), | ||
pants('3rdparty:asm'), | ||
pants('3rdparty:cglib'), | ||
pants('3rdparty:specs'), | ||
pants('oss/zipkin-collector-core'), | ||
], | ||
sources=rglobs('*.scala') | ||
) |
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,15 @@ | ||
maven_layout() | ||
|
||
|
||
jar_library(name='zipkin-collector-scribe', | ||
dependencies=[ | ||
pants('oss/zipkin-collector-scribe/src/main/scala'), | ||
] | ||
) | ||
|
||
jar_library(name='tests', | ||
dependencies=[ | ||
pants('oss/zipkin-collector-scribe/src/test/scala') | ||
] | ||
) | ||
|
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,6 @@ | ||
scala_library(name='scala', | ||
dependencies=[ | ||
pants('oss/zipkin-collector-core'), | ||
], | ||
sources=rglobs('*.scala'), | ||
) |
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,16 @@ | ||
scala_library(name='scala', | ||
dependencies=[ | ||
pants('3rdparty:junit'), | ||
pants('3rdparty:scalatest'), | ||
pants('3rdparty:mockito-all'), | ||
pants('3rdparty:hamcrest-all'), | ||
pants('3rdparty:objenesis'), | ||
pants('3rdparty:jmock'), | ||
pants('3rdparty:asm'), | ||
pants('3rdparty:cglib'), | ||
pants('3rdparty:specs'), | ||
pants('oss/zipkin-collector-core'), | ||
pants('oss/zipkin-collector-scribe'), | ||
], | ||
sources=rglobs('*.scala'), | ||
) |
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,21 @@ | ||
maven_layout() | ||
|
||
|
||
jar_library(name='zipkin-collector-service', | ||
dependencies=[ | ||
pants('oss/zipkin-collector-service/src/main/scala'), | ||
] | ||
) | ||
|
||
jar_library(name='tests', | ||
dependencies=[ | ||
pants('oss/zipkin-collector-service/src/test/scala') | ||
] | ||
) | ||
|
||
dependencies( | ||
name='main', | ||
dependencies=[ | ||
pants('oss/zipkin-collector-service/src/main/scala') | ||
] | ||
) |
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,25 @@ | ||
scala_library(name='scala', | ||
dependencies=[ | ||
pants('3rdparty:algebird-core'), | ||
pants('3rdparty:finagle-exception'), | ||
pants('3rdparty:finagle-serversets'), | ||
pants('3rdparty:finagle-thriftmux'), | ||
pants('3rdparty:finagle-zipkin'), | ||
pants('3rdparty:mustache'), | ||
pants('3rdparty:ostrich'), | ||
pants('3rdparty:twitter-server'), | ||
pants('3rdparty:zookeeper-group'), | ||
pants('3rdparty:zookeeper-server-set'), | ||
pants('oss/zipkin-cassandra'), | ||
pants('oss/zipkin-collector-core'), | ||
pants('oss/zipkin-collector-scribe'), | ||
], | ||
sources=rglobs('*.scala'), | ||
) | ||
|
||
jvm_binary( | ||
name='bin', | ||
basename='zipkin-collector-service', | ||
main='com.twitter.zipkin.collector.Main', | ||
dependencies=[pants(':scala')], | ||
) |
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,13 @@ | ||
junit_tests(name='scala', | ||
dependencies=[ | ||
pants('3rdparty:jmock'), | ||
pants('3rdparty:hamcrest-all'), | ||
pants('3rdparty:cglib'), | ||
pants('3rdparty:asm'), | ||
pants('3rdparty:objenesis'), | ||
pants('3rdparty:specs'), | ||
pants('3rdparty:junit'), | ||
pants('oss/zipkin-collector-service'), | ||
], | ||
sources=rglobs('*.scala') | ||
) |
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,13 @@ | ||
maven_layout() | ||
|
||
jar_library(name='zipkin-collector', | ||
dependencies=[ | ||
pants('oss/zipkin-collector/src/main/scala') | ||
] | ||
) | ||
|
||
jar_library(name='tests', | ||
dependencies=[ | ||
pants('oss/zipkin-collector/src/test/scala') | ||
] | ||
) |
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,10 @@ | ||
scala_library(name='scala', | ||
dependencies=[ | ||
pants('3rdparty:finagle-core'), | ||
pants('3rdparty:util-core'), | ||
pants('3rdparty:twitter-server'), | ||
pants('oss/zipkin-common'), | ||
pants('oss/zipkin-scrooge'), | ||
], | ||
sources=rglobs('*.scala'), | ||
) |
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,8 @@ | ||
junit_tests(name='scala', | ||
dependencies=[ | ||
pants('3rdparty:junit'), | ||
pants('3rdparty:scalatest'), | ||
pants('oss/zipkin-collector'), | ||
], | ||
sources=rglobs('*.scala') | ||
) |
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,13 @@ | ||
maven_layout() | ||
|
||
jar_library(name='zipkin-common', | ||
dependencies=[ | ||
pants('oss/zipkin-common/src/main/scala') | ||
] | ||
) | ||
|
||
jar_library(name='tests', | ||
dependencies=[ | ||
pants('oss/zipkin-common/src/test/scala') | ||
] | ||
) |
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,13 @@ | ||
scala_library(name='scala', | ||
dependencies=[ | ||
pants('3rdparty:finagle-ostrich4'), | ||
pants('3rdparty:finagle-thrift'), | ||
pants('3rdparty:finagle-zipkin'), | ||
pants('3rdparty:finagle-exception'), | ||
pants('3rdparty:util-core'), | ||
pants('3rdparty:zookeeper-client'), | ||
pants('3rdparty:ostrich'), | ||
pants('3rdparty:algebird-core'), | ||
], | ||
sources=rglobs('*.scala'), | ||
) |
21 changes: 21 additions & 0 deletions
21
zipkin-common/src/main/scala/com/twitter/zipkin/common/SpanStoreException.scala
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,21 @@ | ||
/* | ||
* Copyright 2014 Twitter Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.twitter.zipkin.common; | ||
|
||
/** | ||
* Exception in storage layer | ||
*/ | ||
class SpanStoreException(msg: String = "") extends Exception(msg) |
41 changes: 41 additions & 0 deletions
41
zipkin-common/src/main/scala/com/twitter/zipkin/storage/RealtimeAggregates.scala
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,41 @@ | ||
/* | ||
* Copyright 2012 Twitter Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.twitter.zipkin.storage | ||
|
||
import com.twitter.algebird.Monoid | ||
import com.twitter.util.{Closable, CloseAwaitably, Time, Future} | ||
import com.twitter.zipkin.common.Dependencies | ||
|
||
/** | ||
* Storage and retrieval interface for realtime aggregates that are computed online | ||
* and write into online storage | ||
*/ | ||
trait RealtimeAggregates extends Closable with CloseAwaitably { | ||
def getSpanDurations( | ||
timeStamp: Time, | ||
serverServiceName: String, | ||
rpcName: String | ||
): Future[Map[String, List[Long]]] | ||
} | ||
|
||
object NullRealtimeAggregates extends RealtimeAggregates { | ||
def close(deadline: Time): Future[Unit] = closeAwaitably { | ||
Future.Done | ||
} | ||
|
||
def getSpanDurations(timeStamp: Time, serverServiceName: String, rpcName: String) = | ||
Future(Map.empty[String, List[Long]]) | ||
} |
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,10 @@ | ||
junit_tests(name='scala', | ||
dependencies=[ | ||
pants('3rdparty:junit'), | ||
pants('3rdparty:scalatest'), | ||
pants('3rdparty:mockito-all'), | ||
pants('3rdparty:specs'), | ||
pants('oss/zipkin-common'), | ||
], | ||
sources=rglobs('*.scala') | ||
) |
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,13 @@ | ||
maven_layout() | ||
|
||
jar_library(name='zipkin-query', | ||
dependencies=[ | ||
pants('oss/zipkin-query/src/main/scala') | ||
] | ||
) | ||
|
||
jar_library(name='tests', | ||
dependencies=[ | ||
pants('oss/zipkin-query/src/test/scala') | ||
] | ||
) |
Oops, something went wrong.