Skip to content

Commit 2060831

Browse files
removed redundant code
1 parent 6f592ff commit 2060831

File tree

4 files changed

+6
-58
lines changed

4 files changed

+6
-58
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,13 @@ jobs:
1717
- name: Set up Go
1818
uses: actions/setup-go@v4
1919
with:
20-
go-version: '1.25' # Check your go.mod for the correct version
21-
20+
go-version: '1.25'
2221
- name: Build and Package
23-
# This runs the target we just created in your Makefile
2422
run: make build
2523

2624
- name: Create Release
2725
uses: softprops/action-gh-release@v1
2826
with:
29-
# This tells GitHub to pick up any tar.gz file in the bin folder
3027
files: bin/*.tar.gz
3128
env:
3229
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

internal/mongo/helpers.go

Lines changed: 0 additions & 44 deletions
This file was deleted.

internal/mongo/runner.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ func RunWorkload(ctx context.Context, db *mongo.Database, collections []config.C
286286
"update": cfg.UpdatePercent,
287287
"delete": cfg.DeletePercent,
288288
"insert": cfg.InsertPercent,
289-
"aggregate": cfg.AggregatePercent, // Added Aggregation
289+
"aggregate": cfg.AggregatePercent,
290290
},
291291
debug: cfg.DebugMode,
292292
findBatchSize: findBatch,
@@ -395,7 +395,6 @@ func independentWorker(ctx context.Context, id int, wg *sync.WaitGroup, wCfg wor
395395
db := wCfg.database
396396
coll := db.Collection(q.Collection)
397397

398-
// Deep clone logic moved to helpers/below to handle recursion for Pipelines
399398
var filter map[string]interface{}
400399
var pipeline []interface{}
401400

internal/stats/collector.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717
"github.com/Percona-Lab/mongoDB-workload-generator/internal/logger"
1818
)
1919

20-
// ... (Histogram and constants remain the same) ...
2120
const MaxLatencyBin = 10000
2221

2322
type LatencyHistogram struct {
@@ -70,22 +69,21 @@ type Collector struct {
7069
UpdateTotalNs uint64
7170
DeleteOps uint64
7271
DeleteTotalNs uint64
73-
// New Aggregate Counters
74-
AggOps uint64
75-
AggTotalNs uint64
72+
AggOps uint64
73+
AggTotalNs uint64
7674

7775
FindHist *LatencyHistogram
7876
InsertHist *LatencyHistogram
7977
UpdateHist *LatencyHistogram
8078
DeleteHist *LatencyHistogram
81-
AggHist *LatencyHistogram // New
79+
AggHist *LatencyHistogram
8280

8381
startTime time.Time
8482
prevFind uint64
8583
prevInsert uint64
8684
prevUpdate uint64
8785
prevDelete uint64
88-
prevAgg uint64 // New
86+
prevAgg uint64
8987
}
9088

9189
func NewCollector() *Collector {
@@ -203,7 +201,6 @@ func (c *Collector) Monitor(done <-chan struct{}, refreshRateSec int, concurrenc
203201
fmt.Println(logger.GreenString("> Starting Workload..."))
204202
fmt.Println()
205203

206-
// Added AGG column
207204
headerStr := fmt.Sprintf(" %-7s | %9s | %6s | %6s | %6s | %6s | %6s",
208205
"TIME", "TOTAL OPS", "SELECT", "INSERT", "UPDATE", "DELETE", "AGG")
209206

@@ -301,7 +298,6 @@ func (c *Collector) PrintFinalSummary(duration time.Duration) {
301298
fmt.Println()
302299
}
303300

304-
// ... (Helper functions formatInt, formatLatency, printLatencyRow remain unchanged) ...
305301
func printLatencyRow(layout string, label string, h *LatencyHistogram) {
306302
if h.Count == 0 {
307303
fmt.Printf(layout+"\n", label, "-", "-", "-")

0 commit comments

Comments
 (0)