From 40ec4e1aac40fbda8e4e07351558715fc9e5daeb Mon Sep 17 00:00:00 2001 From: Matt Schallert Date: Sun, 10 Feb 2019 15:39:40 -0500 Subject: [PATCH] [m3nsch] support generating new unique metrics `m3nsch` supports generating load for a defined set of metrics, but does not currently support generating new uniques over time. This allows specifying a percentage of generated metrics that will be unique. --- src/cmd/services/m3nsch_client/cmd/util.go | 5 + src/m3nsch/agent/agent.go | 45 +++++-- src/m3nsch/agent/agent_test.go | 20 +++ src/m3nsch/examples/sample_workload.go | 2 + src/m3nsch/generated/convert/to_api.go | 11 +- src/m3nsch/generated/convert/to_proto.go | 1 + .../generated/proto/m3nsch/m3nsch.pb.go | 119 +++++++++++------- .../generated/proto/m3nsch/m3nsch.proto | 1 + src/m3nsch/types.go | 5 + 9 files changed, 148 insertions(+), 61 deletions(-) diff --git a/src/cmd/services/m3nsch_client/cmd/util.go b/src/cmd/services/m3nsch_client/cmd/util.go index d5ae995521..38ca638af3 100644 --- a/src/cmd/services/m3nsch_client/cmd/util.go +++ b/src/cmd/services/m3nsch_client/cmd/util.go @@ -49,6 +49,9 @@ func (w *cliWorkload) validate() error { if w.Namespace == "" { multiErr = multiErr.Add(fmt.Errorf("namespace must be set")) } + if w.UniqueAmplifier < 0.0 || w.UniqueAmplifier > 1.0 { + multiErr = multiErr.Add(fmt.Errorf("unique-amplifier must be between 0.0 and 1.0 (is %f)", w.UniqueAmplifier)) + } return multiErr.FinalError() } @@ -68,4 +71,6 @@ func registerWorkloadFlags(flags *pflag.FlagSet, workload *cliWorkload) { `aggregate workload cardinality`) flags.IntVarP(&workload.IngressQPS, "ingress-qps", "i", 1000, `aggregate workload ingress qps`) + flags.Float64VarP(&workload.UniqueAmplifier, "unique-amplifier", "u", 0.0, + `% of generatic metrics as float [0.0,1.0] that will be unique`) } diff --git a/src/m3nsch/agent/agent.go b/src/m3nsch/agent/agent.go index b4cac4c46b..943dafaf46 100644 --- a/src/m3nsch/agent/agent.go +++ b/src/m3nsch/agent/agent.go @@ -23,12 +23,15 @@ package agent import ( "errors" "fmt" + "strconv" "sync" + "sync/atomic" "time" "github.com/m3db/m3/src/dbnode/client" "github.com/m3db/m3/src/m3nsch" "github.com/m3db/m3/src/m3nsch/datums" + "github.com/m3db/m3x/clock" "github.com/m3db/m3x/ident" "github.com/m3db/m3x/instrument" xlog "github.com/m3db/m3x/log" @@ -43,17 +46,19 @@ var ( type m3nschAgent struct { sync.RWMutex - token string // workload token - workload m3nsch.Workload // workload to operate upon - registry datums.Registry // workload fake metric registry - session client.Session // m3db session to operate upon - agentStatus m3nsch.Status // agent status - opts m3nsch.AgentOptions // agent options - logger xlog.Logger // logger - metrics agentMetrics // agent performance metrics - workerChans workerChannels // worker-idx -> channel for worker notification - workerWg sync.WaitGroup // used to track when workers are finished - params workerParams // worker params + token string // workload token + workload m3nsch.Workload // workload to operate upon + registry datums.Registry // workload fake metric registry + session client.Session // m3db session to operate upon + agentStatus m3nsch.Status // agent status + opts m3nsch.AgentOptions // agent options + logger xlog.Logger // logger + metrics agentMetrics // agent performance metrics + workerChans workerChannels // worker-idx -> channel for worker notification + workerWg sync.WaitGroup // used to track when workers are finished + params workerParams // worker params + lastStartTime int64 // last time a workload was started as unix epoch + nowFn clock.NowFn } type workerParams struct { @@ -72,6 +77,7 @@ func New( registry: registry, opts: opts, logger: opts.InstrumentOptions().Logger(), + nowFn: time.Now, params: workerParams{ fn: workerWriteFn, }, @@ -215,6 +221,7 @@ func (ms *m3nschAgent) Start() error { concurrency := ms.opts.Concurrency() ms.workerChans = newWorkerChannels(concurrency) ms.agentStatus = m3nsch.StatusRunning + atomic.StoreInt64(&ms.lastStartTime, ms.nowFn().Unix()) ms.workerWg.Add(concurrency) for i := 0; i < concurrency; i++ { go ms.runWorker(i, ms.workerChans[i]) @@ -299,7 +306,16 @@ func (ms *m3nschAgent) runWorker(workerIdx int, workerCh chan workerNotification case <-tickLoop.C: fakeNow = fakeNow.Add(tickPeriod) metric := ms.nextWorkerMetric(workerIdx) - start := time.Now() + start := ms.nowFn() + + // If configured to generate uniques over time, modify the metric to add + // cardinality. + if u := ms.workload.UniqueAmplifier; u > 0 { + lastStart := time.Unix(atomic.LoadInt64(&ms.lastStartTime), 0) + suffix := "/" + metricUniqueSuffix(lastStart, ms.nowFn(), u) + metric.name += suffix + } + err := ms.params.fn(workerIdx, ms.session, namespace, metric, fakeNow, timeUnit) elapsed := time.Since(start) methodMetrics.ReportSuccessOrError(err, elapsed) @@ -307,6 +323,11 @@ func (ms *m3nschAgent) runWorker(workerIdx int, workerCh chan workerNotification } } +func metricUniqueSuffix(startTime, now time.Time, uniqueAmplifier float64) string { + n := now.Sub(startTime).Seconds() * uniqueAmplifier + return strconv.Itoa(int(n)) +} + type generatedMetric struct { name string timeseries datums.SyntheticTimeSeries diff --git a/src/m3nsch/agent/agent_test.go b/src/m3nsch/agent/agent_test.go index 90ab66a2c3..ae99a8f963 100644 --- a/src/m3nsch/agent/agent_test.go +++ b/src/m3nsch/agent/agent_test.go @@ -32,6 +32,7 @@ import ( "github.com/m3db/m3x/instrument" xtime "github.com/m3db/m3x/time" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -318,3 +319,22 @@ func TestTransitions(t *testing.T) { err = agent.Stop() require.NoError(t, err) } + +func TestMetricUniqueSuffix(t *testing.T) { + start := time.Unix(0, 0) + for u, exp := range map[float64]int{ + 0: 1, + 0.2: 2, + 0.5: 5, + 1.0: 10, + } { + uniques := make(map[string]struct{}) + for i := 0; i < 10; i++ { + now := start.Add(time.Duration(i) * time.Second) + n := metricUniqueSuffix(start, now, u) + uniques[n] = struct{}{} + } + l := len(uniques) + assert.Equal(t, exp, l, "expected to see %d unique metrics", l) + } +} diff --git a/src/m3nsch/examples/sample_workload.go b/src/m3nsch/examples/sample_workload.go index 166e31fc97..55b0584ac4 100644 --- a/src/m3nsch/examples/sample_workload.go +++ b/src/m3nsch/examples/sample_workload.go @@ -1,3 +1,5 @@ +//+build never + // Copyright (c) 2018 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/m3nsch/generated/convert/to_api.go b/src/m3nsch/generated/convert/to_api.go index 06d5282815..487a5efce0 100644 --- a/src/m3nsch/generated/convert/to_api.go +++ b/src/m3nsch/generated/convert/to_api.go @@ -41,11 +41,12 @@ func ToM3nschWorkload(workload *proto.Workload) (m3nsch.Workload, error) { } return m3nsch.Workload{ - BaseTime: toTimeFromProtoTimestamp(workload.BaseTime), - MetricPrefix: workload.MetricPrefix, - Namespace: workload.Namespace, - Cardinality: int(workload.Cardinality), - IngressQPS: int(workload.IngressQPS), + BaseTime: toTimeFromProtoTimestamp(workload.BaseTime), + MetricPrefix: workload.MetricPrefix, + Namespace: workload.Namespace, + Cardinality: int(workload.Cardinality), + IngressQPS: int(workload.IngressQPS), + UniqueAmplifier: workload.UniqueAmplifier, }, nil } diff --git a/src/m3nsch/generated/convert/to_proto.go b/src/m3nsch/generated/convert/to_proto.go index 2b93b3103a..d8ad9c8d72 100644 --- a/src/m3nsch/generated/convert/to_proto.go +++ b/src/m3nsch/generated/convert/to_proto.go @@ -51,5 +51,6 @@ func ToProtoWorkload(mw m3nsch.Workload) proto.Workload { w.IngressQPS = int32(mw.IngressQPS) w.MetricPrefix = mw.MetricPrefix w.Namespace = mw.Namespace + w.UniqueAmplifier = mw.UniqueAmplifier return w } diff --git a/src/m3nsch/generated/proto/m3nsch/m3nsch.pb.go b/src/m3nsch/generated/proto/m3nsch/m3nsch.pb.go index 9cc46f082d..fb2a214f34 100644 --- a/src/m3nsch/generated/proto/m3nsch/m3nsch.pb.go +++ b/src/m3nsch/generated/proto/m3nsch/m3nsch.pb.go @@ -50,6 +50,8 @@ import google_protobuf "github.com/gogo/protobuf/types" import context "golang.org/x/net/context" import grpc "google.golang.org/grpc" +import binary "encoding/binary" + import io "io" // Reference imports to suppress errors if they are not otherwise used. @@ -251,11 +253,12 @@ func (*StopResponse) ProtoMessage() {} func (*StopResponse) Descriptor() ([]byte, []int) { return fileDescriptorM3Nsch, []int{9} } type Workload struct { - BaseTime *google_protobuf.Timestamp `protobuf:"bytes,1,opt,name=baseTime" json:"baseTime,omitempty"` - MetricPrefix string `protobuf:"bytes,2,opt,name=metricPrefix,proto3" json:"metricPrefix,omitempty"` - Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` - Cardinality int32 `protobuf:"varint,4,opt,name=cardinality,proto3" json:"cardinality,omitempty"` - IngressQPS int32 `protobuf:"varint,5,opt,name=ingressQPS,proto3" json:"ingressQPS,omitempty"` + BaseTime *google_protobuf.Timestamp `protobuf:"bytes,1,opt,name=baseTime" json:"baseTime,omitempty"` + MetricPrefix string `protobuf:"bytes,2,opt,name=metricPrefix,proto3" json:"metricPrefix,omitempty"` + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + Cardinality int32 `protobuf:"varint,4,opt,name=cardinality,proto3" json:"cardinality,omitempty"` + IngressQPS int32 `protobuf:"varint,5,opt,name=ingressQPS,proto3" json:"ingressQPS,omitempty"` + UniqueAmplifier float64 `protobuf:"fixed64,6,opt,name=uniqueAmplifier,proto3" json:"uniqueAmplifier,omitempty"` } func (m *Workload) Reset() { *m = Workload{} } @@ -298,6 +301,13 @@ func (m *Workload) GetIngressQPS() int32 { return 0 } +func (m *Workload) GetUniqueAmplifier() float64 { + if m != nil { + return m.UniqueAmplifier + } + return 0 +} + func init() { proto.RegisterType((*StatusRequest)(nil), "m3nsch.StatusRequest") proto.RegisterType((*StatusResponse)(nil), "m3nsch.StatusResponse") @@ -818,6 +828,12 @@ func (m *Workload) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintM3Nsch(dAtA, i, uint64(m.IngressQPS)) } + if m.UniqueAmplifier != 0 { + dAtA[i] = 0x31 + i++ + binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.UniqueAmplifier)))) + i += 8 + } return i, nil } @@ -948,6 +964,9 @@ func (m *Workload) Size() (n int) { if m.IngressQPS != 0 { n += 1 + sovM3Nsch(uint64(m.IngressQPS)) } + if m.UniqueAmplifier != 0 { + n += 9 + } return n } @@ -1895,6 +1914,17 @@ func (m *Workload) Unmarshal(dAtA []byte) error { break } } + case 6: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field UniqueAmplifier", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.UniqueAmplifier = float64(math.Float64frombits(v)) default: iNdEx = preIndex skippy, err := skipM3Nsch(dAtA[iNdEx:]) @@ -2026,43 +2056,44 @@ func init() { } var fileDescriptorM3Nsch = []byte{ - // 596 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0xc1, 0x6e, 0xd3, 0x4c, - 0x10, 0xc7, 0xbb, 0x69, 0xe3, 0x2f, 0x99, 0x34, 0xa9, 0xbf, 0x25, 0xad, 0x22, 0x0b, 0x85, 0xc8, - 0x07, 0x14, 0x21, 0x64, 0x8b, 0x06, 0xd1, 0x13, 0x87, 0x22, 0x0a, 0xb2, 0xa0, 0xa6, 0x38, 0xad, - 0x2a, 0xf5, 0xb6, 0x71, 0x36, 0xae, 0xd5, 0xda, 0x1b, 0x76, 0x37, 0xd0, 0xbe, 0x05, 0x07, 0xc4, - 0x1b, 0xf0, 0x2a, 0x88, 0x23, 0x8f, 0x80, 0xca, 0x8b, 0x20, 0x7b, 0xd7, 0xb1, 0x93, 0x4b, 0x4f, - 0xd1, 0xfc, 0x66, 0x76, 0x66, 0x3c, 0xff, 0x7f, 0xe0, 0x30, 0x8a, 0xe5, 0xe5, 0x62, 0xe2, 0x84, - 0x2c, 0x71, 0x93, 0xd1, 0x74, 0xe2, 0x26, 0x23, 0x57, 0xf0, 0xd0, 0x4d, 0x46, 0xa9, 0x08, 0x2f, - 0xdd, 0x88, 0xa6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xf3, - 0xdf, 0x9a, 0x9b, 0xfb, 0xdf, 0x6b, 0x60, 0x1c, 0xd3, 0x4c, 0x00, 0x7c, 0xb0, 0x6c, 0xb9, 0xbb, - 0x66, 0x71, 0x75, 0x4c, 0x6b, 0x6f, 0x1d, 0xeb, 0x7f, 0xc8, 0x33, 0xd8, 0xca, 0x54, 0xc7, 0x0f, - 0x8a, 0x7c, 0xc5, 0xaa, 0x56, 0x77, 0x15, 0xea, 0x27, 0xcf, 0xa1, 0x9e, 0xeb, 0x86, 0xbb, 0x95, - 0x9e, 0x4b, 0x59, 0xad, 0xdd, 0x35, 0x5a, 0x0e, 0xca, 0xd4, 0x2c, 0x07, 0x55, 0xa4, 0xb6, 0xba, - 0xab, 0x50, 0x3f, 0x39, 0x00, 0x43, 0x59, 0xa8, 0xfc, 0xa8, 0x15, 0x47, 0x96, 0x1f, 0xb5, 0xea, - 0xb4, 0x57, 0xe6, 0xaf, 0xbb, 0x3e, 0xfa, 0x7d, 0xd7, 0x47, 0x7f, 0xee, 0xfa, 0xe8, 0xeb, 0xdf, - 0xfe, 0xc6, 0xc4, 0xc8, 0x4d, 0x31, 0xfa, 0x17, 0x00, 0x00, 0xff, 0xff, 0xa0, 0x1e, 0x31, 0x14, - 0xa1, 0x04, 0x00, 0x00, + // 617 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0x4d, 0x6e, 0xd3, 0x40, + 0x14, 0xc7, 0x3b, 0x69, 0x63, 0x92, 0x97, 0x26, 0x0d, 0x43, 0x5a, 0x45, 0x11, 0x0a, 0x51, 0x16, + 0x28, 0x42, 0x28, 0x16, 0x0d, 0xa2, 0x2b, 0x16, 0x45, 0x14, 0x14, 0x41, 0x4d, 0x71, 0x5a, 0x55, + 0xea, 0x6e, 0xe2, 0x4c, 0xdc, 0x51, 0x63, 0x8f, 0x3b, 0x33, 0x86, 0xf6, 0x16, 0x2c, 0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, 0x1c, 0x32, 0x65, 0xc6, 0xcc, 0x7b, 0xa1, 0x62, 0xaf, 0x62, 0xcd, 0xd2, + 0x7d, 0x35, 0x93, 0x1a, 0x73, 0x2e, 0x3c, 0x9a, 0x0e, 0x56, 0x71, 0xb5, 0x81, 0xbb, 0x00, 0x8a, + 0x08, 0x9f, 0xaa, 0x0b, 0x1e, 0xd2, 0x74, 0xb2, 0xaa, 0x5b, 0x20, 0xf8, 0x31, 0x54, 0xb5, 0x75, + 0x14, 0x7e, 0x69, 0x97, 0x53, 0x77, 0x0e, 0xfa, 0x0d, 0xd8, 0xd6, 0x63, 0xea, 0xdd, 0xf5, 0x5f, + 0x43, 0xfd, 0x98, 0xcf, 0xd8, 0xfc, 0x36, 0x1b, 0xbc, 0x38, 0x22, 0xba, 0xf7, 0xd9, 0x4d, 0x68, + 0x64, 0xe9, 0xa6, 0x60, 0x03, 0xb6, 0x27, 0x8a, 0x88, 0x6c, 0x11, 0xe6, 0x80, 0x22, 0xef, 0x58, + 0x87, 0xda, 0x44, 0xf1, 0x28, 0xf3, 0xa7, 0xf1, 0x89, 0x69, 0xdc, 0xff, 0x10, 0x54, 0xb2, 0x46, + 0xf8, 0x15, 0x54, 0xa6, 0x44, 0xd2, 0x53, 0x16, 0x50, 0x33, 0x4c, 0x67, 0xa8, 0x15, 0x33, 0xcc, + 0x14, 0x33, 0x3c, 0xcd, 0x14, 0xe3, 0x2e, 0x63, 0x71, 0x1f, 0xb6, 0x03, 0xaa, 0x04, 0xf3, 0x4e, + 0x04, 0x9d, 0xb3, 0x1b, 0x73, 0xf0, 0x15, 0x96, 0xec, 0x29, 0x24, 0x01, 0x95, 0x11, 0x31, 0x1b, + 0xae, 0xba, 0x39, 0xc0, 0x3d, 0xa8, 0x79, 0x44, 0xcc, 0x58, 0x48, 0x16, 0x4c, 0xdd, 0xa6, 0x6b, + 0x2e, 0xbb, 0x45, 0x94, 0xdc, 0x81, 0x85, 0xbe, 0xa0, 0x52, 0x26, 0xda, 0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 0xfe, 0xd7, 0xcb, 0x04, 0x00, 0x00, } diff --git a/src/m3nsch/generated/proto/m3nsch/m3nsch.proto b/src/m3nsch/generated/proto/m3nsch/m3nsch.proto index a7822c1c02..68ef0b891b 100644 --- a/src/m3nsch/generated/proto/m3nsch/m3nsch.proto +++ b/src/m3nsch/generated/proto/m3nsch/m3nsch.proto @@ -64,4 +64,5 @@ message Workload { string namespace = 3; int32 cardinality = 4; int32 ingressQPS = 5; + double uniqueAmplifier = 6; } diff --git a/src/m3nsch/types.go b/src/m3nsch/types.go index 1ca45ca773..4302e122ef 100644 --- a/src/m3nsch/types.go +++ b/src/m3nsch/types.go @@ -64,6 +64,11 @@ type Workload struct { // MetricStartIdx is an offset to control metric numbering. Can be safely ignored // by external callers. MetricStartIdx int + + // UniqueAmplifier is the percentage of unique metrics generated as a float + // between 0.0 and 1.0 that will be unique. This allows for generating metrics + // with steady cardinality rate over time. + UniqueAmplifier float64 } // Coordinator refers to the process responsible for synchronizing load generation.