Source file src/internal/trace/testdata/generators/go123-sync.go

     1  // Copyright 2025 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package main
     6  
     7  import (
     8  	"internal/trace"
     9  	"internal/trace/internal/testgen"
    10  	"internal/trace/tracev2"
    11  	"internal/trace/version"
    12  	"time"
    13  )
    14  
    15  func main() {
    16  	testgen.Main(version.Go123, gen)
    17  }
    18  
    19  func gen(t *testgen.Trace) {
    20  	g1 := t.Generation(1)
    21  	g1.Sync(1000000000, 10, 0, time.Time{})
    22  	b10 := g1.Batch(1, 15)
    23  	b10.Event("ProcStatus", trace.ProcID(0), tracev2.ProcRunning)
    24  	g2 := t.Generation(2)
    25  	g2.Sync(500000000, 20, 0, time.Time{})
    26  	g3 := t.Generation(3)
    27  	b30 := g3.Batch(1, 30)
    28  	b30.Event("ProcStatus", trace.ProcID(0), tracev2.ProcRunning)
    29  	g3.Sync(500000000, 40, 0, time.Time{})
    30  }
    31  

View as plain text