V1.0.2 merge for da real timeing :)
This commit is contained in:
pigwin
2025-12-23 21:44:31 +01:00
committed by GitHub
3 changed files with 19 additions and 16 deletions

View File

@@ -5,7 +5,6 @@ on:
branches: branches:
- main - main
- dev - dev
- v1.0
jobs: jobs:
build: build:
@@ -48,18 +47,12 @@ jobs:
- name: Push Docker image - name: Push Docker image
run: | run: |
# If on v1.0 branch, push to 'testingv1.0' tag # Always push to 'dev' tag
if [[ "${{ github.ref }}" == "refs/heads/v1.0" ]]; then docker tag ti1:${{ env.VERSION }} ${{ secrets.DOCKER_USERNAME }}/ti1:dev
docker tag ti1:${{ env.VERSION }} ${{ secrets.DOCKER_USERNAME }}/ti1:testingv1.0 docker push ${{ secrets.DOCKER_USERNAME }}/ti1:dev
docker push ${{ secrets.DOCKER_USERNAME }}/ti1:testingv1.0
else
# Always push to 'dev' tag for main and dev branches
docker tag ti1:${{ env.VERSION }} ${{ secrets.DOCKER_USERNAME }}/ti1:dev
docker push ${{ secrets.DOCKER_USERNAME }}/ti1:dev
# If the version is valid, also push that specific version tag # If the version is valid, also push that specific version tag
if [[ "${{ env.VERSION }}" != "dev" ]]; then if [[ "${{ env.VERSION }}" != "dev" ]]; then
docker tag ti1:${{ env.VERSION }} ${{ secrets.DOCKER_USERNAME }}/ti1:${{ env.VERSION }} docker tag ti1:${{ env.VERSION }} ${{ secrets.DOCKER_USERNAME }}/ti1:${{ env.VERSION }}
docker push ${{ secrets.DOCKER_USERNAME }}/ti1:${{ env.VERSION }} docker push ${{ secrets.DOCKER_USERNAME }}/ti1:${{ env.VERSION }}
fi
fi fi

View File

@@ -11,6 +11,7 @@ import (
"ti1/config" "ti1/config"
"ti1/data" "ti1/data"
"ti1/database" "ti1/database"
"time"
) )
// DBData is the main entry point for data processing // DBData is the main entry point for data processing
@@ -45,6 +46,9 @@ func DBDataOptimized(data *data.Data) {
} }
fmt.Println("SID:", sid) fmt.Println("SID:", sid)
// Record start time
startTime := time.Now()
// Atomic counters for thread-safe counting // Atomic counters for thread-safe counting
var insertCount, updateCount, estimatedCallInsertCount, estimatedCallUpdateCount, estimatedCallNoneCount, recordedCallInsertCount, recordedCallUpdateCount, recordedCallNoneCount int64 var insertCount, updateCount, estimatedCallInsertCount, estimatedCallUpdateCount, estimatedCallNoneCount, recordedCallInsertCount, recordedCallUpdateCount, recordedCallNoneCount int64
@@ -444,6 +448,9 @@ func DBDataOptimized(data *data.Data) {
close(recordedCallJobs) close(recordedCallJobs)
callWg.Wait() callWg.Wait()
// Record end time
endTime := time.Now()
// Print final stats // Print final stats
fmt.Printf( fmt.Printf(
"\nDONE: EVJ - Inserts: %d, Updates: %d, Total: %d\n"+ "\nDONE: EVJ - Inserts: %d, Updates: %d, Total: %d\n"+
@@ -470,6 +477,9 @@ func DBDataOptimized(data *data.Data) {
serviceDeliveryJsonObject["RecordedCallInserts"] = atomic.LoadInt64(&recordedCallInsertCount) serviceDeliveryJsonObject["RecordedCallInserts"] = atomic.LoadInt64(&recordedCallInsertCount)
serviceDeliveryJsonObject["RecordedCallUpdates"] = atomic.LoadInt64(&recordedCallUpdateCount) serviceDeliveryJsonObject["RecordedCallUpdates"] = atomic.LoadInt64(&recordedCallUpdateCount)
serviceDeliveryJsonObject["RecordedCallNone"] = atomic.LoadInt64(&recordedCallNoneCount) serviceDeliveryJsonObject["RecordedCallNone"] = atomic.LoadInt64(&recordedCallNoneCount)
serviceDeliveryJsonObject["StartTime"] = startTime.Format(time.RFC3339)
serviceDeliveryJsonObject["EndTime"] = endTime.Format(time.RFC3339)
serviceDeliveryJsonObject["Duration"] = endTime.Sub(startTime).String()
// Convert JSON object to JSON string // Convert JSON object to JSON string
serviceDeliveryJsonString, err := json.Marshal(serviceDeliveryJsonObject) serviceDeliveryJsonString, err := json.Marshal(serviceDeliveryJsonObject)

View File

@@ -9,7 +9,7 @@ import (
) )
func main() { func main() {
log.Println("ti1 testing v1.0.0") log.Println("ti1 testing v1.0.2")
log.Println("Starting...") log.Println("Starting...")
// Setup the database // Setup the database