Exemplo n.º 1
0
package testdata_test

import (
	"time"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

	"bonitosrv/testdata"
)

var _ = Describe("GenGen Timerange", func() {
	Context("Simple timestamps generation", func() {
		var gen *testdata.GenGen
		to := time.Now()
		from := to.Add(-1 * time.Minute)
		BeforeEach(func() {
			var err error
			gen, err = testdata.NewGenGen(testdata.GenGenOptions{
				Samples: 100,
				Specs: []map[string]testdata.GenGenSpec{
					map[string]testdata.GenGenSpec{
						"ts": testdata.GenGenSpec{
							Timerange: &testdata.TimerangeOptions{
								From: from,
								To:   to,
							},
						},
					},
				},
			})
Exemplo n.º 2
0
package testdata_test

import (
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

	"bonitosrv/testdata"
)

var _ = Describe("GenGen Timerange", func() {
	Context("Simple fixed string generation", func() {
		var gen *testdata.GenGen
		BeforeEach(func() {
			var err error
			gen, err = testdata.NewGenGen(testdata.GenGenOptions{
				Samples: 10,
				Specs: []map[string]testdata.GenGenSpec{
					map[string]testdata.GenGenSpec{
						"service": testdata.GenGenSpec{
							Fixed: &testdata.FixedOptions{
								Value: "Service 0",
							},
						},
					},
				},
			})

			Expect(err).NotTo(HaveOccurred())
		})

		It("should generate 10 point", func() {
Exemplo n.º 3
0
package testdata_test

import (
	"time"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

	"bonitosrv/testdata"
)

var _ = Describe("GenGen Timerange", func() {
	Context("Two series", func() {
		var gen *testdata.GenGen
		to := time.Now()
		from := to.Add(-1 * time.Minute)
		BeforeEach(func() {
			var err error
			gen, err = testdata.NewGenGen(testdata.GenGenOptions{
				Samples: 100,
				Specs: []map[string]testdata.GenGenSpec{
					map[string]testdata.GenGenSpec{
						"ts": testdata.GenGenSpec{
							Timerange: &testdata.TimerangeOptions{
								From: from,
								To:   to,
							},
						},
						"service": testdata.GenGenSpec{
							Fixed: &testdata.FixedOptions{
								Value: "Service 0",