Documentation ¶
Overview ¶
Copyright (c) YugabyteDB, Inc.
Licensed 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) YugabyteDB, Inc.
Licensed 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
- Variables
- func GetSourceMetadataDBFilePath() string
- func GetTableIndexStatName() string
- func InitAssessmentDB() error
- func SizingAssessment() error
- type AssessmentDB
- type ExpDataColocatedLimit
- type ExpDataShardedLimit
- type ExpDataShardedThroughput
- type IntermediateRecommendation
- type Record
- type SizingAssessmentReport
- type SizingRecommendation
- type SourceDBMetadata
- type TableIndexStats
Constants ¶
const ( TABLE_INDEX_IOPS = "table_index_iops" TABLE_INDEX_SIZES = "table_index_sizes" TABLE_ROW_COUNTS = "table_row_counts" TABLE_COLUMNS_COUNT = "table_columns_count" INDEX_TO_TABLE_MAPPING = "index_to_table_mapping" OBJECT_TYPE_MAPPING = "object_type_mapping" TABLE_COLUMNS_DATA_TYPES = "table_columns_data_types" TABLE_INDEX_STATS = "table_index_stats" PARTITIONED_TABLE_OBJECT_TYPE = "partitioned table" PARTITIONED_INDEX_OBJECT_TYPE = "partitioned index" )
const ( InsertTableStats = `` /* 835-byte string literal not displayed */ // No insertion into 'column_count' for indexes InsertIndexStats = `` /* 769-byte string literal not displayed */ CreateTempTable = `` /* 491-byte string literal not displayed */ UpdateStatsWithRates = `` /* 684-byte string literal not displayed */ )
const ( COLOCATED_LIMITS_TABLE = "colocated_limits" SHARDED_SIZING_TABLE = "sharded_sizing" COLOCATED_LOAD_TIME_TABLE = "colocated_load_time" SHARDED_LOAD_TIME_TABLE = "sharded_load_time" // GITHUB_RAW_LINK use raw github link to fetch the file from repository using the api: // https://raw.githubusercontent.com/{username-or-organization}/{repository}/{branch}/{path-to-file} GITHUB_RAW_LINK = "https://raw.githubusercontent.com/yugabyte/yb-voyager/main/yb-voyager/src/migassessment/resources" EXPERIMENT_DATA_FILENAME = "yb_2024_0_source.db" DBS_DIR = "dbs" SIZE_UNIT_GB = "GB" SIZE_UNIT_MB = "MB" )
Variables ¶
var AssessmentDir string
var ExperimentDB *sql.DB
var SizingReport = &SizingAssessmentReport{}
Functions ¶
func GetSourceMetadataDBFilePath ¶
func GetSourceMetadataDBFilePath() string
func GetTableIndexStatName ¶
func GetTableIndexStatName() string
func InitAssessmentDB ¶
func InitAssessmentDB() error
func SizingAssessment ¶
func SizingAssessment() error
Types ¶
type AssessmentDB ¶
type AssessmentDB struct {
// contains filtered or unexported fields
}
func NewAssessmentDB ¶
func NewAssessmentDB() (*AssessmentDB, error)
func (*AssessmentDB) BulkInsert ¶
func (adb *AssessmentDB) BulkInsert(table string, records [][]string) error
func (*AssessmentDB) FetchAllStats ¶
func (adb *AssessmentDB) FetchAllStats() (*[]TableIndexStats, error)
func (*AssessmentDB) PopulateMigrationAssessmentStats ¶
func (adb *AssessmentDB) PopulateMigrationAssessmentStats() error
populate table_index_stats table using the data from other tables
type ExpDataColocatedLimit ¶
type ExpDataColocatedLimit struct {
// contains filtered or unexported fields
}
type ExpDataShardedLimit ¶
type ExpDataShardedLimit struct {
// contains filtered or unexported fields
}
type ExpDataShardedThroughput ¶
type ExpDataShardedThroughput struct {
// contains filtered or unexported fields
}
type IntermediateRecommendation ¶
type IntermediateRecommendation struct { ColocatedTables []SourceDBMetadata ShardedTables []SourceDBMetadata ColocatedSize float64 ShardedSize float64 NumNodes float64 VCPUsPerInstance int MemoryPerCore int OptimalSelectConnectionsPerNode int64 OptimalInsertConnectionsPerNode int64 EstimatedTimeInMinForImport float64 ParallelVoyagerJobs float64 FailureReasoning string }
type SizingAssessmentReport ¶
type SizingAssessmentReport struct { SizingRecommendation SizingRecommendation FailureReasoning string }
type SizingRecommendation ¶
type SizingRecommendation struct { ColocatedTables []string ColocatedReasoning string ShardedTables []string NumNodes float64 VCPUsPerInstance int MemoryPerInstance int OptimalSelectConnectionsPerNode int64 OptimalInsertConnectionsPerNode int64 EstimatedTimeInMinForImport float64 ParallelVoyagerJobs float64 }
type SourceDBMetadata ¶
type SourceDBMetadata struct { SchemaName string `db:"schema_name"` ObjectName string `db:"object_name"` RowCount sql.NullInt64 `db:"row_count,string"` ColumnCount sql.NullInt64 `db:"column_count,string"` Reads int64 `db:"reads,string"` Writes int64 `db:"writes,string"` ReadsPerSec int64 `db:"reads_per_second,string"` WritesPerSec int64 `db:"writes_per_second,string"` IsIndex bool `db:"is_index,string"` ParentTableName sql.NullString `db:"parent_table_name"` Size float64 `db:"size_in_bytes,string"` }
type TableIndexStats ¶
type TableIndexStats struct { SchemaName string `json:"SchemaName"` ObjectName string `json:"ObjectName"` RowCount *int64 `json:"RowCount"` // Pointer to allows null values ColumnCount *int64 `json:"ColumnCount"` Reads *int64 `json:"Reads"` Writes *int64 `json:"Writes"` ReadsPerSecond *int64 `json:"ReadsPerSecond"` WritesPerSecond *int64 `json:"WritesPerSecond"` IsIndex bool `json:"IsIndex"` ObjectType string `json:"ObjectType"` ParentTableName *string `json:"ParentTableName"` SizeInBytes *int64 `json:"SizeInBytes"` }