api_load

package
v0.0.0-...-b9085d8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2020 License: MIT Imports: 11 Imported by: 0

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.

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run()

Types

type Config

type Config struct {
	PolarisURL      string
	PolarisEmail    string
	PolarisPassword string

	LogLevel string

	Port int

	LoadGenerator *LoadGeneratorConfig
	DataSeeder    *DataSeederConfig
}

func GetConfig

func GetConfig(configPath string) (*Config, error)

GetConfig ...

func (*Config) GetLogLevel

func (config *Config) GetLogLevel() (log.Level, error)

GetLogLevel ...

type CreateRoleAssignmentJob

type CreateRoleAssignmentJob struct {
	JobId     int
	UserId    string
	RoleId    string
	ProjectId string
	OrgId     string
}

type CreateUserJob

type CreateUserJob struct {
	JobId int
	Email string
	Name  string
	OrgId string
}

type DataSeeder

type DataSeeder struct {
	Client          *api.Client
	UsersToCreate   int
	Concurrency     int
	Projects        map[string]string
	Users           map[string]string
	UserNameToId    map[string]string
	Roles           map[string]string
	Organizations   map[string]string
	RoleAssignments map[string]*RoleAssignment
}

func NewDataSeeder

func NewDataSeeder(client *api.Client, usersToCreate int, concurrency int) (*DataSeeder, error)

func (*DataSeeder) CreateRoleAssignments

func (ds *DataSeeder) CreateRoleAssignments(stop <-chan struct{}) error

type DataSeederConfig

type DataSeederConfig struct {
	Concurrency   int
	UsersToCreate int
}

type LoadGenerationWorker

type LoadGenerationWorker struct {
	Id        string
	EventName string
	Func      func() error
	Stop      <-chan struct{}
}

func NewLoadGenerationWorker

func NewLoadGenerationWorker(id string, eventName string, f func() error, stop <-chan struct{}) *LoadGenerationWorker

func (*LoadGenerationWorker) Start

func (lgw *LoadGenerationWorker) Start()

type LoadGenerator

type LoadGenerator struct {
	Client         *api.Client
	WorkerRequests map[string]int
	Workers        map[string]*LoadGenerationWorker
	Stop           <-chan struct{}
}

func NewLoadGenerator

func NewLoadGenerator(client *api.Client, workerRequests map[string]int, stop <-chan struct{}) *LoadGenerator

func (*LoadGenerator) StartGeneratingLoad

func (loadGen *LoadGenerator) StartGeneratingLoad()

type LoadGeneratorConfig

type LoadGeneratorConfig struct {
	WorkerRequests map[string]int
}

type RoleAssignment

type RoleAssignment struct {
	Organization   string
	User           string
	Role           string
	Object         string
	ToOrganization string
	ToProject      string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL