Documentation ¶
Overview ¶
Copyright (C) 2020 Synopsys, Inc.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (C) 2020 Synopsys, Inc.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (C) 2020 Synopsys, Inc.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (C) 2020 Synopsys, Inc.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func Reauthenticator(polarisClient *api.Client, stop <-chan struct{})
- func Run(configPath string)
- func RunLoadGenerator(config *Config) (*IssueServerLoadGenerator, *AuthLoadGenerator, error)
- func RunLoginsForUsers(client *api.Client, userCount int) error
- func RunRateLimiterTests()
- type AdaptiveRateAdjuster
- type AuthConfig
- type AuthLoadGenerator
- type BaseRateSetter
- func Add(fs ...BaseRateSetter) BaseRateSetter
- func AmplitudeFromArray(vals []float64, durationSeconds float64) BaseRateSetter
- func Const(baseline float64) BaseRateSetter
- func Linear(slope float64) BaseRateSetter
- func Piecewise(pieces []*Piece) BaseRateSetter
- func ShiftRight(seconds float64, f BaseRateSetter) BaseRateSetter
- func Sinusoid(baseline float64, amplitude float64, period float64, phase float64) BaseRateSetter
- func Spike(baseline float64, lowDuration float64, height float64, highDuration float64, ...) BaseRateSetter
- type Config
- type ErrorFractionThresholdConfig
- type FuncJobSource
- type IssueServerConfig
- type IssueServerLoadGenerator
- type IssuesSource
- type JobSource
- type LoadConfig
- type LoadManager
- type LoadWorker
- type MainBranchProject
- type Piece
- type PostRoleAssignmentsSource
- type ProjectFetcher
- func (pf *ProjectFetcher) GetMainBranchProject(index int) *MainBranchProject
- func (pf *ProjectFetcher) GetProject(index int) *api.VinylV0Project
- func (pf *ProjectFetcher) IsDone() bool
- func (pf *ProjectFetcher) MainBranchProjectsLength() int
- func (pf *ProjectFetcher) ProjectsLength() int
- func (pf *ProjectFetcher) Start()
- func (pf *ProjectFetcher) Stop()
- type RateConfig
- type RateLimiter
- type RoleAssignmentsPager
- type RoleAssignmentsPagerSource
- type RoleAssignmentsSingleProjectSource
- type RollupCountsPager
- type RollupCountsSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Reauthenticator ¶
func RunLoadGenerator ¶
func RunLoadGenerator(config *Config) (*IssueServerLoadGenerator, *AuthLoadGenerator, error)
func RunRateLimiterTests ¶
func RunRateLimiterTests()
Types ¶
type AdaptiveRateAdjuster ¶
type AuthConfig ¶
type AuthConfig struct { PreRunLogins int Entitlements *LoadConfig Login *LoadConfig RoleAssignmentsPager map[string]*RoleAssignmentsPager RoleAssignmentsSingleProject *LoadConfig CreateRoleAssignments *LoadConfig }
type AuthLoadGenerator ¶
type AuthLoadGenerator struct { Config *AuthConfig // contains filtered or unexported fields }
func NewAuthLoadGenerator ¶
func NewAuthLoadGenerator(projects *ProjectFetcher, url string, email string, password string, config *AuthConfig) *AuthLoadGenerator
func (*AuthLoadGenerator) Stop ¶
func (alg *AuthLoadGenerator) Stop()
type BaseRateSetter ¶
func Add ¶
func Add(fs ...BaseRateSetter) BaseRateSetter
func AmplitudeFromArray ¶
func AmplitudeFromArray(vals []float64, durationSeconds float64) BaseRateSetter
func Const ¶
func Const(baseline float64) BaseRateSetter
func Linear ¶
func Linear(slope float64) BaseRateSetter
func Piecewise ¶
func Piecewise(pieces []*Piece) BaseRateSetter
func ShiftRight ¶
func ShiftRight(seconds float64, f BaseRateSetter) BaseRateSetter
type Config ¶
type Config struct { PolarisURL string PolarisEmail string PolarisPassword string LogLevel string Port int LoadGenerator struct { Issue *IssueServerConfig Auth *AuthConfig } }
type ErrorFractionThresholdConfig ¶
type ErrorFractionThresholdConfig struct { IncreaseRatio float64 IncreaseMaxErrorFraction float64 DecreaseRatio float64 DecreaseMinErrorFraction float64 MaxRate float64 MinRate float64 }
func (*ErrorFractionThresholdConfig) RateAdjuster ¶
func (conf *ErrorFractionThresholdConfig) RateAdjuster() AdaptiveRateAdjuster
type FuncJobSource ¶
type FuncJobSource struct {
// contains filtered or unexported fields
}
func (*FuncJobSource) RunJob ¶
func (fjs *FuncJobSource) RunJob() (string, error)
type IssueServerConfig ¶
type IssueServerConfig struct { FetchProjectsCount int Issues *LoadConfig RollupCounts *RollupCountsPager }
type IssueServerLoadGenerator ¶
type IssueServerLoadGenerator struct { Config *IssueServerConfig // contains filtered or unexported fields }
func NewIssueServerLoadGenerator ¶
func NewIssueServerLoadGenerator(polarisClient *api.Client, projects *ProjectFetcher, config *IssueServerConfig) *IssueServerLoadGenerator
func (*IssueServerLoadGenerator) Stop ¶
func (c *IssueServerLoadGenerator) Stop()
type IssuesSource ¶
type IssuesSource struct { Projects *ProjectFetcher Offset int Index int // contains filtered or unexported fields }
func NewIssuesSource ¶
func NewIssuesSource(client *api.Client, projects *ProjectFetcher, start int) *IssuesSource
func (*IssuesSource) RunJob ¶
func (is *IssuesSource) RunJob() (string, error)
type LoadConfig ¶
type LoadConfig struct { WorkersCount int Rate *RateConfig }
type LoadManager ¶
type LoadManager struct { Name string // contains filtered or unexported fields }
func NewLoadManager ¶
func NewLoadManager(name string, js JobSource, workerCount int, rateLimiter *RateLimiter) *LoadManager
type LoadWorker ¶
type LoadWorker struct { WorkerId string // contains filtered or unexported fields }
func NewLoadWorker ¶
func NewLoadWorker(runJob func(), workerId string) *LoadWorker
type MainBranchProject ¶
type Piece ¶
type Piece struct { DurationSeconds float64 BaseRateSetter BaseRateSetter }
type PostRoleAssignmentsSource ¶
type PostRoleAssignmentsSource struct { Name string // contains filtered or unexported fields }
func NewPostRoleAssignmentsSource ¶
func NewPostRoleAssignmentsSource(name string, client *api.Client) (*PostRoleAssignmentsSource, error)
func (*PostRoleAssignmentsSource) RunJob ¶
func (pras *PostRoleAssignmentsSource) RunJob() (string, error)
type ProjectFetcher ¶
func NewProjectFetcher ¶
func NewProjectFetcher(client *api.Client, start int, limit int) *ProjectFetcher
func NewProjectFetcherWithRandomStart ¶
func NewProjectFetcherWithRandomStart(client *api.Client, limit int) *ProjectFetcher
func (*ProjectFetcher) GetMainBranchProject ¶
func (pf *ProjectFetcher) GetMainBranchProject(index int) *MainBranchProject
func (*ProjectFetcher) GetProject ¶
func (pf *ProjectFetcher) GetProject(index int) *api.VinylV0Project
func (*ProjectFetcher) IsDone ¶
func (pf *ProjectFetcher) IsDone() bool
func (*ProjectFetcher) MainBranchProjectsLength ¶
func (pf *ProjectFetcher) MainBranchProjectsLength() int
func (*ProjectFetcher) ProjectsLength ¶
func (pf *ProjectFetcher) ProjectsLength() int
func (*ProjectFetcher) Start ¶
func (pf *ProjectFetcher) Start()
func (*ProjectFetcher) Stop ¶
func (pf *ProjectFetcher) Stop()
type RateConfig ¶
type RateConfig struct { RateChangePeriodSeconds float64 Constant *struct { Baseline float64 } Sinusoid *struct { Baseline float64 Amplitude float64 Period float64 Phase float64 } Spike *struct { Baseline float64 LowPeriodSeconds float64 Height float64 HighPeriodSeconds float64 RampSeconds float64 } AdaptiveRateAdjuster *ErrorFractionThresholdConfig }
func (*RateConfig) MustRateLimiter ¶
func (rc *RateConfig) MustRateLimiter(name string) *RateLimiter
func (*RateConfig) RateSetter ¶
func (rc *RateConfig) RateSetter() (BaseRateSetter, error)
type RateLimiter ¶
type RateLimiter struct { Name string // contains filtered or unexported fields }
func NewRateLimiter ¶
func NewRateLimiter(name string, getRate BaseRateSetter, rateChangePeriod time.Duration, errorAdjuster AdaptiveRateAdjuster) *RateLimiter
func (*RateLimiter) Finish ¶
func (rl *RateLimiter) Finish(desc string, err error)
func (*RateLimiter) Limit ¶
func (rl *RateLimiter) Limit() float64
func (*RateLimiter) Stop ¶
func (rl *RateLimiter) Stop()
func (*RateLimiter) Wait ¶
func (rl *RateLimiter) Wait()
type RoleAssignmentsPager ¶
type RoleAssignmentsPager struct { LoadConfig *LoadConfig PageSize int }
type RoleAssignmentsPagerSource ¶
type RoleAssignmentsPagerSource struct { Page int Name string PageSize int // contains filtered or unexported fields }
func (*RoleAssignmentsPagerSource) RunJob ¶
func (raps *RoleAssignmentsPagerSource) RunJob() (string, error)
type RoleAssignmentsSingleProjectSource ¶
type RoleAssignmentsSingleProjectSource struct { Index int // contains filtered or unexported fields }
func NewRoleAssignmentsSingleProjectSource ¶
func NewRoleAssignmentsSingleProjectSource(client *api.Client, projects *ProjectFetcher) *RoleAssignmentsSingleProjectSource
func (*RoleAssignmentsSingleProjectSource) RunJob ¶
func (raps *RoleAssignmentsSingleProjectSource) RunJob() (string, error)
type RollupCountsPager ¶
type RollupCountsPager struct { LoadConfig *LoadConfig PageSize int }
type RollupCountsSource ¶
type RollupCountsSource struct { Projects *ProjectFetcher Index int Limit int // contains filtered or unexported fields }
func NewRollupCountsSource ¶
func NewRollupCountsSource(client *api.Client, projects *ProjectFetcher, start int, limit int) *RollupCountsSource
func (*RollupCountsSource) RunJob ¶
func (rcs *RollupCountsSource) RunJob() (string, error)