Skip to content

Commit 3c3ff69

Browse files
committed
[core] Update Bookkeeping API
1 parent 430f2a2 commit 3c3ff69

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

core/bookkeeping/api.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func Instance() *BookkeepingWrapper {
6666
return instance
6767
}
6868

69-
func (bk *BookkeepingWrapper) CreateRun(activityId string, nDetectors int, nEpns int, nFlps int, runNumber int32, runType string, timeO2Start time.Time, timeTrgStart time.Time) {
69+
func (bk *BookkeepingWrapper) CreateRun(activityId string, nDetectors int, nEpns int, nFlps int, runNumber int32, runType string, timeO2Start time.Time, timeTrgStart time.Time, dd_flp bool, dcs bool, epn bool) {
7070
var runtypeAPI sw.RunType
7171
switch runType {
7272
case string(sw.TECHNICAL_RunType):
@@ -80,7 +80,7 @@ func (bk *BookkeepingWrapper) CreateRun(activityId string, nDetectors int, nEpns
8080
runtypeAPI = sw.TECHNICAL_RunType
8181
}
8282

83-
clientAPI.CreateRun(activityId, int32(nDetectors), int32(nEpns), int32(nFlps), runNumber, runtypeAPI, timeO2Start, timeTrgStart)
83+
clientAPI.CreateRun(activityId, int32(nDetectors), int32(nEpns), int32(nFlps), runNumber, runtypeAPI, timeO2Start, timeTrgStart, dd_flp, dcs, epn)
8484
}
8585

8686
func (bk *BookkeepingWrapper) UpdateRun(runNumber int32, runResult string, timeO2End time.Time, timeTrgEnd time.Time) {
@@ -108,8 +108,8 @@ func (bk *BookkeepingWrapper) CreateFlp(name string, hostName string, runNumber
108108
clientAPI.CreateFlp(name, hostName, runNumber)
109109
}
110110

111-
func (bk *BookkeepingWrapper) UpdateFlp(flpId int32, name string, nSubtimeframes int32, nEquipmentBytes int32, nRecordingBytes int32, nFairMQBytes int32) {
112-
clientAPI.UpdateFlp(flpId, name, nSubtimeframes, nEquipmentBytes, nRecordingBytes, nFairMQBytes)
111+
func (bk *BookkeepingWrapper) UpdateFlp(name string, runNumber int32, nSubtimeframes int32, nEquipmentBytes int32, nRecordingBytes int32, nFairMQBytes int32) {
112+
clientAPI.UpdateFlp(name, runNumber, nSubtimeframes, nEquipmentBytes, nRecordingBytes, nFairMQBytes)
113113
}
114114

115115
func (bk *BookkeepingWrapper) GetLogs() {

core/environment/transition_startactivity.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ func (t StartActivityTransition) do(env *Environment) (err error) {
6565
}
6666

6767
flps := env.GetFLPs()
68-
the.BookkeepingAPI().CreateRun(env.Id().String(), len(env.GetActiveDetectors()), 0, len(flps), int32(runNumber), env.GetRunType().String(), time.Now(), time.Now())
68+
dd_enabled, _ := strconv.ParseBool(env.GetKV("","dd_enabled"))
69+
dcs_enabled, _ := strconv.ParseBool(env.GetKV("","dcs_enabled"))
70+
epn_enabled, _ := strconv.ParseBool(env.GetKV("","epn_enabled"))
71+
the.BookkeepingAPI().CreateRun(env.Id().String(), len(env.GetActiveDetectors()), 0, len(flps), int32(runNumber), env.GetRunType().String(), time.Now(), time.Now(), dd_enabled, dcs_enabled, epn_enabled )
6972
for _, flp := range flps {
7073
the.BookkeepingAPI().CreateFlp(flp, flp, int32(runNumber))
7174
}

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ require (
2020
cloud.google.com/go v0.76.0 // indirect
2121
cloud.google.com/go/firestore v1.4.0 // indirect
2222
github.com/AlecAivazis/survey/v2 v2.2.7
23-
github.com/AliceO2Group/Bookkeeping v0.16.9 // indirect
24-
github.com/AliceO2Group/Bookkeeping/go-api-client v0.0.0-20210504163454-decc0eed681e
23+
github.com/AliceO2Group/Bookkeeping v0.17.6 // indirect
24+
github.com/AliceO2Group/Bookkeeping/go-api-client v0.0.0-20210917100552-e0d4d674fe89
2525
github.com/BurntSushi/xgb v0.0.0-20210121224620-deaf085860bc // indirect
2626
github.com/Masterminds/goutils v1.1.1 // indirect
2727
github.com/Masterminds/semver v1.5.0 // indirect
@@ -55,7 +55,7 @@ require (
5555
github.com/go-yaml/yaml v2.1.0+incompatible // indirect
5656
github.com/gobwas/glob v0.2.3
5757
github.com/golang/protobuf v1.4.3
58-
github.com/google/uuid v1.2.0 // indirect
58+
github.com/google/uuid v1.2.0
5959
github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 // indirect
6060
github.com/gorilla/mux v1.7.3
6161
github.com/grpc-ecosystem/go-grpc-middleware v1.2.0 // indirect

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,16 @@ github.com/AliceO2Group/Bookkeeping v0.16.8 h1:xNiRFMaCNLGZaDwTJz0i5l2wrkxbGfcb2
8585
github.com/AliceO2Group/Bookkeeping v0.16.8/go.mod h1:Ig2ePkJuGnTF9NH+f8f1h5A8yGIuWowPHBlpQHn/0NU=
8686
github.com/AliceO2Group/Bookkeeping v0.16.9 h1:yqMR7e4FDjAeNbSJ08WJJN1ug0k/VyFiEwx6Aiw4Ju0=
8787
github.com/AliceO2Group/Bookkeeping v0.16.9/go.mod h1:Ig2ePkJuGnTF9NH+f8f1h5A8yGIuWowPHBlpQHn/0NU=
88+
github.com/AliceO2Group/Bookkeeping v0.17.6 h1:O6D3wr5+twn0JQHiSz5+4TWdhNmWFYqxxdtPXUxlAjI=
89+
github.com/AliceO2Group/Bookkeeping v0.17.6/go.mod h1:Ig2ePkJuGnTF9NH+f8f1h5A8yGIuWowPHBlpQHn/0NU=
8890
github.com/AliceO2Group/Bookkeeping/go-api-client v0.0.0-20210308150404-e78be0de914f h1:s8o3xu0+3TrjYuRypa5C4XyLOIpoLxupdnS5z2LetDU=
8991
github.com/AliceO2Group/Bookkeeping/go-api-client v0.0.0-20210308150404-e78be0de914f/go.mod h1:w64yucnc/ncO+KGk26OY4Uhy+Vf/WAbU85ZfunlN7XM=
9092
github.com/AliceO2Group/Bookkeeping/go-api-client v0.0.0-20210409104827-fd1b74c641ba h1:hbiftnpE/yrRFcuuo2DGOtLhcyy1SFer1cWLS/GWG00=
9193
github.com/AliceO2Group/Bookkeeping/go-api-client v0.0.0-20210409104827-fd1b74c641ba/go.mod h1:w64yucnc/ncO+KGk26OY4Uhy+Vf/WAbU85ZfunlN7XM=
9294
github.com/AliceO2Group/Bookkeeping/go-api-client v0.0.0-20210504163454-decc0eed681e h1:9rLFEKaGcH6nmz2JcM4zcfKuGJq+/nPVr30o33s7/eM=
9395
github.com/AliceO2Group/Bookkeeping/go-api-client v0.0.0-20210504163454-decc0eed681e/go.mod h1:w64yucnc/ncO+KGk26OY4Uhy+Vf/WAbU85ZfunlN7XM=
96+
github.com/AliceO2Group/Bookkeeping/go-api-client v0.0.0-20210917100552-e0d4d674fe89 h1:Wfo58o2d/ILS7Kz+tmVEBb/Gg9Dd2bOr17gH+Na3lKU=
97+
github.com/AliceO2Group/Bookkeeping/go-api-client v0.0.0-20210917100552-e0d4d674fe89/go.mod h1:w64yucnc/ncO+KGk26OY4Uhy+Vf/WAbU85ZfunlN7XM=
9498
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
9599
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
96100
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc=

0 commit comments

Comments
 (0)