当前位置: 首页>>代码示例>>Golang>>正文


Golang dopplerforwarder.DopplerForwarder类代码示例

本文整理汇总了Golang中metron/writers/dopplerforwarder.DopplerForwarder的典型用法代码示例。如果您正苦于以下问题:Golang DopplerForwarder类的具体用法?Golang DopplerForwarder怎么用?Golang DopplerForwarder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了DopplerForwarder类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1:

	"github.com/cloudfoundry/loggregatorlib/loggregatorclient"

	"time"

	"github.com/cloudfoundry/dropsonde/metric_sender/fake"
	"github.com/cloudfoundry/dropsonde/metricbatcher"
	"github.com/cloudfoundry/dropsonde/metrics"
	"github.com/cloudfoundry/gosteno"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("DopplerForwarder", func() {
	var (
		clientPool *mockClientPool
		logger     *gosteno.Logger
		forwarder  *dopplerforwarder.DopplerForwarder
	)

	BeforeEach(func() {
		clientPool = &mockClientPool{}
		logger = loggertesthelper.Logger()
		forwarder = dopplerforwarder.New(clientPool, logger)
	})

	It("sends messages to a random doppler", func() {
		message := []byte("Some message")
		forwarder.Write(message)

		Expect(clientPool.randomClient).ToNot(BeNil())
开发者ID:pkdevbox,项目名称:loggregator,代码行数:30,代码来源:doppler_forwarder_test.go

示例2:

	"metron/writers/dopplerforwarder"

	. "github.com/apoydence/eachers"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

	"github.com/cloudfoundry/dropsonde/metricbatcher"
	"github.com/cloudfoundry/gosteno"
	"github.com/cloudfoundry/loggregatorlib/loggertesthelper"
)

var _ = Describe("DopplerForwarder", func() {
	var (
		clientPool  *mockClientPool
		client      *mockClient
		logger      *gosteno.Logger
		forwarder   *dopplerforwarder.DopplerForwarder
		fakeWrapper *mockNetworkWrapper
		message     []byte
	)

	BeforeEach(func() {
		message = []byte("I am a message!")

		client = newMockClient()
		clientPool = newMockClientPool()
		clientPool.RandomClientOutput.Client <- client
		close(clientPool.RandomClientOutput.Err)

		logger = loggertesthelper.Logger()
		loggertesthelper.TestLoggerSink.Clear()
开发者ID:kei-yamazaki,项目名称:loggregator,代码行数:31,代码来源:doppler_forwarder_test.go

示例3:

	"github.com/cloudfoundry/dropsonde/metric_sender/fake"
	"github.com/cloudfoundry/dropsonde/metricbatcher"
	"github.com/cloudfoundry/dropsonde/metrics"
	"github.com/cloudfoundry/dropsonde/signature"
	"github.com/cloudfoundry/gosteno"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var sharedSecret = []byte("secret")

var _ = Describe("DopplerForwarder", func() {
	var (
		sender     *fake.FakeMetricSender
		clientPool *fakes.FakeClientPool
		client     *fakeclient.FakeClient
		logger     *gosteno.Logger
		forwarder  *dopplerforwarder.DopplerForwarder
		envelope   *events.Envelope
	)

	BeforeEach(func() {
		sender = fake.NewFakeMetricSender()
		metrics.Initialize(sender, metricbatcher.New(sender, time.Millisecond*10))

		client = &fakeclient.FakeClient{}
		clientPool = &fakes.FakeClientPool{}
		clientPool.RandomClientReturns(client, nil)

		logger = loggertesthelper.Logger()
		loggertesthelper.TestLoggerSink.Clear()
开发者ID:nagyistoce,项目名称:cloudfoundry-loggregator,代码行数:31,代码来源:doppler_forwarder_test.go

示例4:

	"github.com/cloudfoundry/dropsonde/metricbatcher"
	"github.com/cloudfoundry/dropsonde/metrics"
	"github.com/cloudfoundry/dropsonde/signature"
	"github.com/cloudfoundry/gosteno"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var sharedSecret = []byte("secret")

var _ = Describe("DopplerForwarder", func() {
	var (
		sender     *fake.FakeMetricSender
		clientPool *fakes.FakeClientPool
		client     *fakeclient.FakeClient
		logger     *gosteno.Logger
		forwarder  *dopplerforwarder.DopplerForwarder
		envelope   *events.Envelope
		doneChan   chan struct{}
		bufferSize uint
	)

	BeforeEach(func() {
		sender = fake.NewFakeMetricSender()
		metrics.Initialize(sender, metricbatcher.New(sender, time.Millisecond*10))

		client = &fakeclient.FakeClient{}
		clientPool = &fakes.FakeClientPool{}
		clientPool.RandomClientReturns(client, nil)

		logger = loggertesthelper.Logger()
		loggertesthelper.TestLoggerSink.Clear()
开发者ID:hpcloud,项目名称:loggregator-1,代码行数:32,代码来源:doppler_forwarder_test.go

示例5:

	"time"

	"github.com/cloudfoundry/dropsonde/metric_sender/fake"
	"github.com/cloudfoundry/dropsonde/metricbatcher"
	"github.com/cloudfoundry/dropsonde/metrics"
	"github.com/cloudfoundry/gosteno"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("DopplerForwarder", func() {
	var (
		sender      *fake.FakeMetricSender
		clientPool  *mockClientPool
		client      *mockClient
		logger      *gosteno.Logger
		forwarder   *dopplerforwarder.DopplerForwarder
		fakeWrapper *mockNetworkWrapper
		message     []byte
	)

	BeforeEach(func() {
		message = []byte("I am a message!")

		sender = fake.NewFakeMetricSender()
		metrics.Initialize(sender, metricbatcher.New(sender, time.Millisecond*10))

		client = newMockClient()
		clientPool = newMockClientPool()
		clientPool.RandomClientOutput.client <- client
		close(clientPool.RandomClientOutput.err)
开发者ID:yingkitw,项目名称:loggregator,代码行数:31,代码来源:doppler_forwarder_test.go


注:本文中的metron/writers/dopplerforwarder.DopplerForwarder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。