Skip to content

Commit

Permalink
Merge pull request #74 from ExpediaDotCom/package-restructure-opencensus
Browse files Browse the repository at this point in the history
restructure the package name for opencensus module
  • Loading branch information
keshavpeswani authored Dec 7, 2018
2 parents 2aa276c + d17e08b commit d9c72aa
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
*/

package com.www.expedia.opencensus.exporter.trace;
package com.expedia.www.opencensus.exporter.trace;

import com.expedia.open.tracing.Log;
import com.expedia.open.tracing.Tag;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
*
*/

package com.www.expedia.opencensus.exporter.trace;
package com.expedia.www.opencensus.exporter.trace;

import com.expedia.open.tracing.Span;
import com.expedia.www.haystack.client.dispatchers.clients.Client;
import com.expedia.www.haystack.client.dispatchers.clients.GRPCAgentProtoClient;
import com.expedia.www.haystack.client.dispatchers.clients.HttpCollectorProtoClient;
import com.expedia.www.haystack.client.metrics.Metrics;
import com.expedia.www.haystack.client.metrics.NoopMetricsRegistry;
import com.www.expedia.opencensus.exporter.trace.config.DispatcherConfig;
import com.www.expedia.opencensus.exporter.trace.config.GrpcAgentDispatcherConfig;
import com.www.expedia.opencensus.exporter.trace.config.HttpDispatcherConfig;
import com.expedia.www.opencensus.exporter.trace.config.DispatcherConfig;
import com.expedia.www.opencensus.exporter.trace.config.GrpcAgentDispatcherConfig;
import com.expedia.www.opencensus.exporter.trace.config.HttpDispatcherConfig;
import io.opencensus.trace.Tracing;
import io.opencensus.trace.export.SpanExporter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
*/

package com.www.expedia.opencensus.exporter.trace.config;
package com.expedia.www.opencensus.exporter.trace.config;

import org.apache.commons.lang3.Validate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
*/

package com.www.expedia.opencensus.exporter.trace.config;
package com.expedia.www.opencensus.exporter.trace.config;

import org.apache.commons.lang3.Validate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
*/

package com.www.expedia.opencensus.exporter.trace.config;
package com.expedia.www.opencensus.exporter.trace.config;

import org.apache.commons.lang3.Validate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
*
*/

package com.www.expedia.opencensus.exporter.trace

package com.expedia.www.opencensus.exporter.trace

import java.util.Collections

Expand All @@ -29,6 +28,7 @@ import io.opencensus.trace.{MessageEvent, Tracestate, _}
import org.easymock.EasyMock
import org.scalatest._
import org.scalatest.easymock.EasyMockSugar

import scala.collection.JavaConverters._

class HaystackExporterHandlerSpec extends FunSpec with GivenWhenThen with Matchers with EasyMockSugar {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,14 @@
*
*/

package com.www.expedia.opencensus.exporter.trace
package com.expedia.www.opencensus.exporter.trace


import java.util
import java.util.{Collections, Random}

import com.www.expedia.opencensus.exporter.trace.config.GrpcAgentDispatcherConfig
import com.expedia.www.opencensus.exporter.trace.config.GrpcAgentDispatcherConfig
import io.opencensus.trace._
import io.opencensus.trace.samplers.Samplers
import org.apache.kafka.clients.consumer.ConsumerConfig._
import org.apache.kafka.clients.consumer.KafkaConsumer
import org.apache.kafka.clients.consumer.{ConsumerConfig, KafkaConsumer}
import org.apache.kafka.common.serialization.{ByteArrayDeserializer, StringDeserializer}
import org.scalatest.{BeforeAndAfterAll, FunSpec, GivenWhenThen, Matchers}

Expand All @@ -34,16 +31,15 @@ import scala.collection.JavaConverters._
class HaystackExporterIntegrationSpec extends FunSpec with GivenWhenThen with Matchers with BeforeAndAfterAll {
private val OPERATION_NAME = "/search"
private val SERVICE_NAME = "my-service"
private val START_TIME_MICROS = System.currentTimeMillis() * 1000
private val MAX_DURATION_MILLIS = 10
private var consumer: KafkaConsumer[String, Array[Byte]] = _

override def beforeAll(): Unit = {
Thread.sleep(20000)
val config: java.util.Map[String, Object] = new util.HashMap()
config.put(BOOTSTRAP_SERVERS_CONFIG, "kafkasvc:9092")
config.put(GROUP_ID_CONFIG, "integration_test")
config.put(AUTO_OFFSET_RESET_CONFIG, "earliest")
val config: java.util.Map[String, Object] = new java.util.HashMap()
config.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "kafkasvc:9092")
config.put(ConsumerConfig.GROUP_ID_CONFIG, "integration_test")
config.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest")
consumer = new KafkaConsumer(config, new StringDeserializer(), new ByteArrayDeserializer())
consumer.subscribe(Collections.singleton("proto-spans"))
}
Expand All @@ -70,6 +66,7 @@ class HaystackExporterIntegrationSpec extends FunSpec with GivenWhenThen with Ma
tracer.getCurrentSpan.putAttribute("error", AttributeValue.booleanAttributeValue(true))
tracer.getCurrentSpan.addAnnotation("done searching",
Collections.singletonMap("someevent", AttributeValue.longAttributeValue(200)))

} catch {
case _: Exception =>
tracer.getCurrentSpan.addAnnotation("Exception thrown when processing!")
Expand Down Expand Up @@ -102,7 +99,6 @@ class HaystackExporterIntegrationSpec extends FunSpec with GivenWhenThen with Ma
protoSpan.getTraceId shouldEqual record.key()
protoSpan.getServiceName shouldEqual SERVICE_NAME
protoSpan.getOperationName shouldEqual OPERATION_NAME
protoSpan.getStartTime should be >= START_TIME_MICROS
protoSpan.getTagsCount shouldBe 5
protoSpan.getTagsList.asScala.find(_.getKey == "span.kind").get.getVStr shouldEqual "server"
protoSpan.getTagsList.asScala.find(_.getKey == "foo").get.getVStr shouldEqual "bar"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
*
*/

package com.www.expedia.opencensus.exporter.trace
package com.expedia.www.opencensus.exporter.trace

import com.www.expedia.opencensus.exporter.trace.config.{GrpcAgentDispatcherConfig, HttpDispatcherConfig}
import com.expedia.www.opencensus.exporter.trace.config.{GrpcAgentDispatcherConfig, HttpDispatcherConfig}
import org.scalatest.{FunSpec, GivenWhenThen, Matchers}

class HaystackTraceExporterSpec extends FunSpec with GivenWhenThen with Matchers {
Expand Down

0 comments on commit d9c72aa

Please sign in to comment.