@@ -2,33 +2,28 @@ package main
22
33import (
44 "fmt"
5- "github.com/cheggaaa/pb/v3"
6- "github.com/pvelx/triggerHook/error_service"
7- "github.com/pvelx/triggerHook/monitoring_service"
8- "github.com/pvelx/triggerHook/repository"
9- "github.com/pvelx/triggerHook/util"
105 "log"
116 "math/rand"
127 "sync"
138 "time"
149
15- "github.com/pvelx/triggerHook"
16- "github.com/pvelx/triggerHook/connection"
17- "github.com/pvelx/triggerHook/contracts"
18- "github.com/pvelx/triggerHook/domain"
10+ "github.com/cheggaaa/pb/v3"
11+ "github.com/pvelx/triggerhook"
12+ "github.com/pvelx/triggerhook/connection"
13+ "github.com/pvelx/triggerhook/contracts"
14+ "github.com/pvelx/triggerhook/domain"
15+ "github.com/pvelx/triggerhook/error_service"
16+ "github.com/pvelx/triggerhook/monitoring_service"
17+ "github.com/pvelx/triggerhook/repository"
18+ "github.com/pvelx/triggerhook/util"
1919)
2020
2121func upInitialState (taskCount int ) {
2222
2323 fmt .Println ("\n up initial state" )
2424 preparingBar := pb .StartNew (taskCount )
2525
26- conn := connection .NewMysqlClient (connection.Options {
27- User : "root" ,
28- Password : "secret" ,
29- Host : "127.0.0.1:3306" ,
30- DbName : "test_db" ,
31- })
26+ conn := connection .New (nil )
3227 errorService := error_service .New (nil )
3328 repositoryService := repository .New (conn , util .NewId (), errorService , nil )
3429
@@ -73,17 +68,17 @@ func sendingAndConfirmation(taskCount int) [][]string {
7368 fmt .Println ("\n sending/confirmation tasks" )
7469 preparingBar := pb .StartNew (taskCount )
7570
76- triggerHookService := triggerHook .Build (triggerHook .Config {
71+ triggerHookService := triggerhook .Build (triggerhook .Config {
7772 Connection : connection.Options {
78- User : "root" ,
79- Password : "secret" ,
80- Host : "127.0.0.1:3306" ,
81- DbName : "test_db" ,
73+ User : mysqlUser ,
74+ Password : mysqlPassword ,
75+ Host : mysqlHost ,
76+ DbName : mysqlDbName ,
8277 },
8378 MonitoringServiceOptions : monitoring_service.Options {
8479 PeriodMeasure : 100 * time .Millisecond ,
8580 Subscriptions : map [contracts.Topic ]func (event contracts.MeasurementEvent ){
86- contracts .SpeedOfConfirmation : func (event contracts.MeasurementEvent ) {
81+ contracts .ConfirmationRate : func (event contracts.MeasurementEvent ) {
8782 confirmed = confirmed + int (event .Measurement )
8883 preparingBar .Add (int (event .Measurement ))
8984 if confirmed == taskCount {
0 commit comments