本文整理匯總了Golang中github.com/cgrates/cgrates/engine.StopStartEngine函數的典型用法代碼示例。如果您正苦於以下問題:Golang StopStartEngine函數的具體用法?Golang StopStartEngine怎麽用?Golang StopStartEngine使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了StopStartEngine函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: TestRPCITStartSecondEngine
func TestRPCITStartSecondEngine(t *testing.T) {
if !*testIntegration {
return
}
if ral2, err = engine.StopStartEngine(rpcITCfgPath2, *waitRater); err != nil {
t.Fatal(err)
}
}
示例2: TestSMGStartEngine
// Start CGR Engine
func TestSMGStartEngine(t *testing.T) {
if !*testIntegration {
return
}
if _, err := engine.StopStartEngine(daCfgPath, *waitRater); err != nil {
t.Fatal(err)
}
}
示例3: TestTPitStartEngine
// Start CGR Engine
func TestTPitStartEngine(t *testing.T) {
if !*testTP {
return
}
if _, err := engine.StopStartEngine(tpCfgPath, delay); err != nil { // Mongo requires more time to start
t.Fatal(err)
}
}
示例4: TestCsvITStartEngine
func TestCsvITStartEngine(t *testing.T) {
if !*testIT {
return
}
if _, err := engine.StopStartEngine(csvCfgPath, *waitRater); err != nil {
t.Fatal(err)
}
}
示例5: TestDmtAgentStartEngine
// Start CGR Engine
func TestDmtAgentStartEngine(t *testing.T) {
if !*testIntegration {
return
}
if _, err := engine.StopStartEngine(daCfgPath, 4000); err != nil {
t.Fatal(err)
}
}
示例6: TestCdrsStartMasterEngine
func TestCdrsStartMasterEngine(t *testing.T) {
if !*testIntegration {
return
}
if _, err := engine.StopStartEngine(cdrsMasterCfgPath, *waitRater); err != nil {
t.Fatal(err)
}
}
示例7: TestSMGRplcStartEngine
// Start CGR Engine
func TestSMGRplcStartEngine(t *testing.T) {
if _, err := engine.StopStartEngine(smgRplcSlaveCfgPath, *waitRater); err != nil { // Start slave before master
t.Fatal(err)
}
if _, err := engine.StartEngine(smgRplcMasterCfgPath, *waitRater); err != nil {
t.Fatal(err)
}
}
示例8: TestCDRStatsLclStartEngine
func TestCDRStatsLclStartEngine(t *testing.T) {
if !*testLocal {
return
}
if _, err := engine.StopStartEngine(cdrstCfgPath, 1000); err != nil {
t.Fatal(err)
}
}
示例9: TestV2CDRsPSQLStartEngine
func TestV2CDRsPSQLStartEngine(t *testing.T) {
if !*testLocal {
return
}
if _, err := engine.StopStartEngine(cdrsPsqlCfgPath, *waitRater); err != nil {
t.Fatal(err)
}
}
示例10: TestTutLocalStartEngine
// Start CGR Engine
func TestTutLocalStartEngine(t *testing.T) {
if !*testLocal {
return
}
if _, err := engine.StopStartEngine(tutLocalCfgPath, *waitRater); err != nil {
t.Fatal(err)
}
}
示例11: TestApierV2itStartEngine
// Start CGR Engine
func TestApierV2itStartEngine(t *testing.T) {
if !*testIT {
return
}
if _, err := engine.StopStartEngine(apierCfgPath, 200); err != nil { // Mongo requires more time to start
t.Fatal(err)
}
}
示例12: TestFlatstoreLclStartEngine
func TestFlatstoreLclStartEngine(t *testing.T) {
if !*testLocal {
return
}
if _, err := engine.StopStartEngine(flatstoreCfgPath, *waitRater); err != nil {
t.Fatal(err)
}
}
示例13: TestSTIStartEngine
// Start CGR Engine
func TestSTIStartEngine(t *testing.T) {
if !*testSureTax {
return
}
if _, err := engine.StopStartEngine(*configDir, *waitRater); err != nil {
t.Fatal(err)
}
}
示例14: TestTpStartEngine
// Start CGR Engine
func TestTpStartEngine(t *testing.T) {
if !*testIntegration {
return
}
fmt.Printf("Before starting: %v\n", time.Now())
if _, err := engine.StopStartEngine(tpCfgPath, 1000); err != nil {
t.Fatal(err)
}
fmt.Printf("After starting: %v\n", time.Now())
}
示例15: TestCDRStatsitStatsPersistence
// Test stats persistence
func TestCDRStatsitStatsPersistence(t *testing.T) {
time.Sleep(time.Duration(2) * time.Second) // Allow stats to be updated in dataDb
if _, err := engine.StopStartEngine(cdrstCfgPath, *waitRater); err != nil {
t.Fatal(err)
}
var err error
cdrstRpc, err = jsonrpc.Dial("tcp", cdrstCfg.RPCJSONListen) // We connect over JSON so we can also troubleshoot if needed
if err != nil {
t.Fatal("Could not connect to rater: ", err.Error())
}
var rcvMetrics map[string]float64
expectedMetrics := map[string]float64{"ASR": 75, "ACD": 15}
if err := cdrstRpc.Call("CDRStatsV1.GetMetrics", AttrGetMetrics{StatsQueueId: "CDRST4"}, &rcvMetrics); err != nil {
t.Error("Calling CDRStatsV1.GetMetrics, got error: ", err.Error())
} else if !reflect.DeepEqual(expectedMetrics, rcvMetrics) {
t.Errorf("Expecting: %v, received: %v", expectedMetrics, rcvMetrics)
}
}