-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds ability to receive debug flag from Finagle. If the debug flag is…
… set on a span we ensure it is stored. This allows developers to force tracing on a request Author: @johanoskarsson Fixes #86 URL: #86
- Loading branch information
1 parent
a5e1ee3
commit a75e854
Showing
10 changed files
with
88 additions
and
40 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
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
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
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
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
24 changes: 0 additions & 24 deletions
24
...-server/src/main/scala/com/twitter/zipkin/collector/sampler/EverythingGlobalSampler.scala
This file was deleted.
Oops, something went wrong.
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
50 changes: 50 additions & 0 deletions
50
...er/src/test/scala/com/twitter/zipkin/collector/processor/SamplerProcessorFilterSpec.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,50 @@ | ||
package com.twitter.zipkin.collector.processor | ||
|
||
/* | ||
* 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. | ||
* | ||
*/ | ||
|
||
import org.specs.Specification | ||
import com.twitter.zipkin.gen | ||
import com.twitter.zipkin.common.{Span, Endpoint, Annotation} | ||
import com.twitter.ostrich.stats.{Histogram, Distribution, Stats} | ||
import com.twitter.zipkin.collector.sampler.{EverythingGlobalSampler, NullGlobalSampler} | ||
|
||
class SamplerProcessorFilterSpec extends Specification { | ||
|
||
"SamplerProcessorFilter" should { | ||
"let the span pass if debug flag is set" in { | ||
val span = Span(12345, "methodcall", 666, None, List(), Nil, true) | ||
val spans = Seq(span) | ||
val samplerProcessor = new SamplerProcessorFilter(NullGlobalSampler) | ||
samplerProcessor(spans) mustEqual spans | ||
} | ||
|
||
"let the span pass if debug flag false and sampler says yes" in { | ||
val span = Span(12345, "methodcall", 666, None, List(), Nil, false) | ||
val spans = Seq(span) | ||
val samplerProcessor = new SamplerProcessorFilter(EverythingGlobalSampler) | ||
samplerProcessor(spans) mustEqual spans | ||
} | ||
|
||
"don't let the span pass if debug flag false and sampler says no" in { | ||
val span = Span(12345, "methodcall", 666, None, List(), Nil, false) | ||
val spans = Seq(span) | ||
val samplerProcessor = new SamplerProcessorFilter(NullGlobalSampler) | ||
samplerProcessor(spans) mustEqual Seq() | ||
} | ||
} | ||
} |
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
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