inprove reporting???!?!!!!!.

This commit is contained in:
pigwin
2025-01-09 19:28:10 +00:00
parent 083a267b2a
commit d996411adf
3 changed files with 10 additions and 6 deletions

View File

@@ -83,7 +83,7 @@ func InsertOrUpdateEstimatedCall(ctx context.Context, db *sql.DB, values []inter
} }
return id, action, nil return id, action, nil
} else { } else {
fmt.Printf("MATCH!!! Original Hash: %s, Retrieved Hash: %s\n", hashString, retrievedHash) //fmt.Printf("MATCH!!! Original Hash: %s, Retrieved Hash: %s\n", hashString, retrievedHash)
return 0, "no update", nil return 0, "none", nil
} }
} }

View File

@@ -38,7 +38,7 @@ func DBData(data *data.Data) {
fmt.Println("SID:", sid) fmt.Println("SID:", sid)
// counters // counters
var insertCount, updateCount, totalCount, estimatedCallInsertCount, estimatedCallUpdateCount, recordedCallInsertCount, recordedCallUpdateCount int var insertCount, updateCount, totalCount, estimatedCallInsertCount, estimatedCallUpdateCount, estimatedCallNoneCount, recordedCallInsertCount, recordedCallUpdateCount int
for _, journey := range data.ServiceDelivery.EstimatedTimetableDelivery[0].EstimatedJourneyVersionFrame.EstimatedVehicleJourney { for _, journey := range data.ServiceDelivery.EstimatedTimetableDelivery[0].EstimatedJourneyVersionFrame.EstimatedVehicleJourney {
var values []interface{} var values []interface{}
@@ -169,12 +169,13 @@ func DBData(data *data.Data) {
//fmt.Printf("Inserts: %d, Updates: %d, Total: %d\n", insertCount, updateCount, totalCount) //fmt.Printf("Inserts: %d, Updates: %d, Total: %d\n", insertCount, updateCount, totalCount)
if totalCount%1000 == 0 { if totalCount%1000 == 0 {
fmt.Printf( fmt.Printf(
"Inserts: %d, Updates: %d, Total: %d; estimatedCalls = I: %d U: %d; recordedCalls = I: %d U: %d\n", "Inserts: %d, Updates: %d, Total: %d; estimatedCalls = I: %d U: %d N: %d; recordedCalls = I: %d U: %d\n",
insertCount, insertCount,
updateCount, updateCount,
totalCount, totalCount,
estimatedCallInsertCount, estimatedCallInsertCount,
estimatedCallUpdateCount, estimatedCallUpdateCount,
estimatedCallNoneCount,
recordedCallInsertCount, recordedCallInsertCount,
recordedCallUpdateCount, recordedCallUpdateCount,
) )
@@ -313,6 +314,8 @@ func DBData(data *data.Data) {
estimatedCallInsertCount++ estimatedCallInsertCount++
} else if action == "update" { } else if action == "update" {
estimatedCallUpdateCount++ estimatedCallUpdateCount++
} else if action == "none" {
estimatedCallNoneCount++
} }
} }
} }
@@ -397,12 +400,13 @@ func DBData(data *data.Data) {
} }
fmt.Printf( fmt.Printf(
"DONE: Inserts: %d, Updates: %d, Total: %d; estimatedCalls = I: %d U: %d; recordedCalls = I: %d U: %d\n", "DONE: Inserts: %d, Updates: %d, Total: %d; estimatedCalls = I: %d U: %d N: %d; recordedCalls = I: %d U: %d\n",
insertCount, insertCount,
updateCount, updateCount,
totalCount, totalCount,
estimatedCallInsertCount, estimatedCallInsertCount,
estimatedCallUpdateCount, estimatedCallUpdateCount,
estimatedCallNoneCount,
recordedCallInsertCount, recordedCallInsertCount,
recordedCallUpdateCount, recordedCallUpdateCount,
) )

View File

@@ -9,7 +9,7 @@ import (
) )
func main() { func main() {
log.Println("ti1 v0.1.2 - 09.01...") log.Println("ti1 v0.1.2 - 09.01.2025..")
log.Println("Starting...") log.Println("Starting...")
// Setup the database // Setup the database