當前位置: 首頁>>代碼示例>>Golang>>正文


Golang modetest.Signals函數代碼示例

本文整理匯總了Golang中github.com/elastic/beats/libbeat/outputs/mode/modetest.Signals函數的典型用法代碼示例。如果您正苦於以下問題:Golang Signals函數的具體用法?Golang Signals怎麽用?Golang Signals使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了Signals函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: testSingleSendFlakyGuaranteed

func testSingleSendFlakyGuaranteed(t *testing.T, events []modetest.EventInfo) {
	var collected [][]outputs.Data
	mode, _ := New(
		modetest.NewMockClient(&modetest.MockClient{
			CBPublish: modetest.PublishCollectAfterFailStart(25, &collected),
		}),
		3,
		1*time.Millisecond,
		1*time.Millisecond,
		10*time.Millisecond,
	)
	modetest.TestMode(t, mode, testGuaranteed, events, modetest.Signals(true), &collected)
}
開發者ID:YaSuenag,項目名稱:hsbeat,代碼行數:13,代碼來源:single_test.go

示例2: testSingleSendFlakyFail

func testSingleSendFlakyFail(t *testing.T, events []modetest.EventInfo) {
	var collected [][]common.MapStr
	mode, _ := New(
		modetest.NewMockClient(&modetest.MockClient{
			CBPublish: modetest.PublishCollectAfterFailStart(3, &collected),
		}),
		3,
		1*time.Millisecond,
		1*time.Millisecond,
		10*time.Millisecond,
	)
	modetest.TestMode(t, mode, testNoOpts, events, modetest.Signals(false), &collected)
}
開發者ID:ChongFeng,項目名稱:beats,代碼行數:13,代碼來源:single_test.go

示例3: testLoadBalancerFlakyGuaranteed

func testLoadBalancerFlakyGuaranteed(t *testing.T, events []modetest.EventInfo) {
	var collected [][]common.MapStr
	mode, _ := NewSync(
		modetest.SyncClients(2, &modetest.MockClient{
			Connected: true,
			CBPublish: modetest.PublishCollectAfterFailStart(25, &collected),
		}),
		3,
		1*time.Millisecond,
		1*time.Millisecond,
		10*time.Millisecond,
	)
	modetest.TestMode(t, mode, testGuaranteed, events, modetest.Signals(true), &collected)
}
開發者ID:ChongFeng,項目名稱:beats,代碼行數:14,代碼來源:lbsync_test.go

示例4: testSingleSendOneEvent

func testSingleSendOneEvent(t *testing.T, events []modetest.EventInfo) {
	var collected [][]outputs.Data
	mode, _ := New(
		modetest.NewMockClient(&modetest.MockClient{
			Connected: true,
			CBPublish: modetest.PublishCollect(&collected),
		}),
		3,
		1*time.Millisecond,
		1*time.Millisecond,
		10*time.Millisecond,
	)
	modetest.TestMode(t, mode, testNoOpts, events, modetest.Signals(true), &collected)
}
開發者ID:YaSuenag,項目名稱:hsbeat,代碼行數:14,代碼來源:single_test.go

示例5: testLoadBalancerOKSend

func testLoadBalancerOKSend(t *testing.T, events []modetest.EventInfo) {
	var collected [][]outputs.Data
	mode, _ := NewSync(
		modetest.SyncClients(1, &modetest.MockClient{
			Connected: false,
			CBPublish: modetest.PublishCollect(&collected),
		}),
		2,
		1*time.Millisecond,
		1*time.Millisecond,
		10*time.Millisecond,
	)
	modetest.TestMode(t, mode, testNoOpts, events, modetest.Signals(true), &collected)
}
開發者ID:YaSuenag,項目名稱:hsbeat,代碼行數:14,代碼來源:lbsync_test.go

示例6: testLoadBalancerFlakyConnectionOkSend

func testLoadBalancerFlakyConnectionOkSend(t *testing.T, events []modetest.EventInfo) {
	var collected [][]outputs.Data
	mode, _ := NewSync(
		modetest.SyncClients(2, &modetest.MockClient{
			Connected: true,
			CBPublish: modetest.PublishCollectAfterFailStart(1, &collected),
		}),
		3,
		1*time.Millisecond,
		1*time.Millisecond,
		10*time.Millisecond,
	)
	modetest.TestMode(t, mode, testNoOpts, events, modetest.Signals(true), &collected)
}
開發者ID:YaSuenag,項目名稱:hsbeat,代碼行數:14,代碼來源:lbsync_test.go

示例7: testAsyncLBFailSendWithoutActiveConnection

func testAsyncLBFailSendWithoutActiveConnection(t *testing.T, events []modetest.EventInfo) {
	enableLogging([]string{"*"})

	errFail := errors.New("fail connect")
	mode, _ := NewAsync(
		modetest.AsyncClients(2, &modetest.MockClient{
			CBConnect: modetest.ConnectFail(errFail),
		}),
		2,
		100*time.Millisecond,
		100*time.Millisecond,
		1*time.Second,
	)
	modetest.TestMode(t, mode, testNoOpts, events, modetest.Signals(false), nil)
}
開發者ID:ChongFeng,項目名稱:beats,代碼行數:15,代碼來源:lbasync_test.go

示例8: testAsyncLBTemporayFailure

func testAsyncLBTemporayFailure(t *testing.T, events []modetest.EventInfo) {
	var collected [][]common.MapStr
	mode, _ := NewAsync(
		modetest.AsyncClients(1, &modetest.MockClient{
			Connected: true,
			CBAsyncPublish: modetest.AsyncPublishCollectAfterFailStartWith(
				1, mode.ErrTempBulkFailure, &collected),
		}),
		3,
		100*time.Millisecond,
		100*time.Millisecond,
		1*time.Second,
	)
	modetest.TestMode(t, mode, testNoOpts, events, modetest.Signals(true), &collected)
}
開發者ID:ChongFeng,項目名稱:beats,代碼行數:15,代碼來源:lbasync_test.go

示例9: testAsyncLBOKSend

func testAsyncLBOKSend(t *testing.T, events []modetest.EventInfo) {
	enableLogging([]string{"*"})

	var collected [][]common.MapStr
	mode, _ := NewAsync(
		modetest.AsyncClients(1, &modetest.MockClient{
			CBAsyncPublish: modetest.AsyncPublishCollect(&collected),
		}),
		2,
		100*time.Millisecond,
		100*time.Millisecond,
		1*time.Second,
	)
	modetest.TestMode(t, mode, testNoOpts, events, modetest.Signals(true), &collected)
}
開發者ID:ChongFeng,項目名稱:beats,代碼行數:15,代碼來源:lbasync_test.go

示例10: testAsyncLBFlakyConnectionOkSend

func testAsyncLBFlakyConnectionOkSend(t *testing.T, events []modetest.EventInfo) {
	var collected [][]common.MapStr
	tmpl := &modetest.MockClient{
		Connected:      true,
		CBAsyncPublish: modetest.AsyncPublishCollectAfterFailStart(1, &collected),
	}
	mode, _ := NewAsync(
		modetest.AsyncClients(2, tmpl),
		3,
		100*time.Millisecond,
		100*time.Millisecond,
		1*time.Second,
	)
	modetest.TestMode(t, mode, testNoOpts, events, modetest.Signals(true), &collected)
}
開發者ID:ChongFeng,項目名稱:beats,代碼行數:15,代碼來源:lbasync_test.go

示例11: testLoadBalancerTempFlakyInfAttempts

func testLoadBalancerTempFlakyInfAttempts(t *testing.T, events []modetest.EventInfo) {
	var collected [][]common.MapStr
	err := mode.ErrTempBulkFailure
	mode, _ := NewSync(
		modetest.SyncClients(2, &modetest.MockClient{
			Connected: true,
			CBPublish: modetest.PublishCollectAfterFailStartWith(25, err, &collected),
		}),
		0,
		1*time.Millisecond,
		1*time.Millisecond,
		10*time.Millisecond,
	)
	modetest.TestMode(t, mode, testNoOpts, events, modetest.Signals(true), &collected)
}
開發者ID:ChongFeng,項目名稱:beats,代碼行數:15,代碼來源:lbsync_test.go

示例12: testSingleSendFlakyInfAttempts

func testSingleSendFlakyInfAttempts(t *testing.T, events []modetest.EventInfo) {
	enableLogging([]string{"*"})

	var collected [][]outputs.Data
	mode, _ := New(
		modetest.NewMockClient(&modetest.MockClient{
			CBPublish: modetest.PublishCollectAfterFailStart(25, &collected),
		}),
		0, // infinite number of send attempts
		1*time.Millisecond,
		1*time.Millisecond,
		10*time.Millisecond,
	)
	modetest.TestMode(t, mode, testNoOpts, events, modetest.Signals(true), &collected)
}
開發者ID:YaSuenag,項目名稱:hsbeat,代碼行數:15,代碼來源:single_test.go

示例13: testLoadBalancerTempFlakyGuaranteed

func testLoadBalancerTempFlakyGuaranteed(t *testing.T, events []modetest.EventInfo) {
	var collected [][]outputs.Data
	err := mode.ErrTempBulkFailure
	mode, _ := NewSync(
		modetest.SyncClients(2, &modetest.MockClient{
			Connected: true,
			CBPublish: modetest.PublishCollectAfterFailStartWith(25, err, &collected),
		}),
		3,
		1*time.Millisecond,
		1*time.Millisecond,
		10*time.Millisecond,
	)
	modetest.TestMode(t, mode, testGuaranteed, events, modetest.Signals(true), &collected)
}
開發者ID:YaSuenag,項目名稱:hsbeat,代碼行數:15,代碼來源:lbsync_test.go

示例14: testSingleConnectionFail

func testSingleConnectionFail(t *testing.T, events []modetest.EventInfo) {
	var collected [][]outputs.Data
	errFail := errors.New("fail connect")
	mode, _ := New(
		modetest.NewMockClient(&modetest.MockClient{
			Connected: false,
			CBConnect: modetest.ConnectFail(errFail),
			CBPublish: modetest.PublishCollect(&collected),
		}),
		3,
		1*time.Millisecond,
		1*time.Millisecond,
		10*time.Millisecond,
	)
	modetest.TestMode(t, mode, testNoOpts, events, modetest.Signals(false), &collected)
}
開發者ID:YaSuenag,項目名稱:hsbeat,代碼行數:16,代碼來源:single_test.go

示例15: testSingleConnectFailConnectAndSend

func testSingleConnectFailConnectAndSend(t *testing.T, events []modetest.EventInfo) {
	var collected [][]common.MapStr
	errFail := errors.New("fail connect")
	mode, _ := New(
		modetest.NewMockClient(&modetest.MockClient{
			Connected: false,
			CBConnect: modetest.ConnectFailN(2, errFail),
			CBPublish: modetest.PublishCollect(&collected),
		}),
		3,
		1*time.Millisecond,
		1*time.Millisecond,
		10*time.Millisecond,
	)
	modetest.TestMode(t, mode, testNoOpts, events, modetest.Signals(true), &collected)
}
開發者ID:ChongFeng,項目名稱:beats,代碼行數:16,代碼來源:single_test.go


注:本文中的github.com/elastic/beats/libbeat/outputs/mode/modetest.Signals函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。