Пример #1
0
Файл: top.go Проект: rmpalmer/io
func main() {
	fmt.Printf("io test starting.\n")
	d := dscout.NewDscout("bar.xml.gz")
	t := records.NewTrace(6, 16)
	for i := 0; i < 4; i++ {
		t.Header[i] = i
	}
	for i := 0; i < 10; i++ {
		t.Data[i] = 10.5 - float64(i)
	}
	for i := 0; i < 5; i++ {
		t.Header[0] = i
		d.HandleTrace(t)
	}
	d.HandleEod()

	e := dscin.NewDscin("bar.xml.gz")
	for {
		t = e.HandleTrace()
		if t == nil {
			break
		} else {
			t.Summarize()
			t.Detail()
		}
	}

	fmt.Printf("io testy done\n")
}
Пример #2
0
func (d *Datgen) Execute() {
	fmt.Printf("d will generate %d recs\n", d.nrecs)
	var t *records.Trace
	var g *records.Global
	g = records.NewGlobal(0, 4, 1000)
	if d.Sink != nil {
		d.Sink <- g
	}
	for i := 0; i < d.nrecs; i++ {
		t = records.NewTrace(64, 1024)
		t.Header[0] = i
		fmt.Printf("generate %d\n", t.Header[0])
		if d.Sink != nil {
			d.Sink <- t
		}
	}
	if d.Sink != nil {
		close(d.Sink)
	}
	d.Operation.Waiter.Done()
}