kis-flow/test/kis_metrics_test.go

38 lines
551 B
Go
Raw Permalink Normal View History

2024-03-04 14:53:29 +08:00
package test
import (
"context"
"fmt"
2024-03-04 14:53:29 +08:00
"testing"
"time"
2024-04-16 15:11:23 +08:00
"github.com/aceld/kis-flow/file"
"github.com/aceld/kis-flow/kis"
2024-03-04 14:53:29 +08:00
)
func TestMetricsDataTotal(t *testing.T) {
ctx := context.Background()
2024-03-20 18:09:08 +08:00
if err := file.ConfigImportYaml("load_conf/"); err != nil {
fmt.Println("Wrong Config Yaml Path!")
2024-03-04 14:53:29 +08:00
panic(err)
}
flow1 := kis.Pool().GetFlow("flowName1")
n := 0
for n < 10 {
_ = flow1.CommitRow("This is Data1 from Test")
if err := flow1.Run(ctx); err != nil {
panic(err)
}
time.Sleep(1 * time.Second)
n++
}
select {}
}