Skip to content

Commit 4fc8990

Browse files
authored
Merge pull request #9 from iluhinsky/feature/opensearch
Added OpenSearch support
2 parents f1bf9b1 + 6a43e40 commit 4fc8990

File tree

21 files changed

+1204
-663
lines changed

21 files changed

+1204
-663
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ It includes:
1212

1313
## Acronis Database Benchmark (acronis-db-bench)
1414

15-
The Acronis Database Benchmark is a comprehensive framework for testing and analyzing the performance of various database systems. It supports a wide range of both SQL and NoSQL databases, such as MySQL, PostgreSQL, Cassandra, ClickHouse, ElasticSearch and more, making it a powerful tool for cross-database performance comparisons. The tool provides extensive support for different data access patterns, including inserts, updates, facet searches, indexed searches, vector searches, and others, allowing for a detailed exploration of how each database handles different query types and workloads.
15+
The Acronis Database Benchmark is a comprehensive framework for testing and analyzing the performance of various database systems. It supports a wide range of both SQL and NoSQL databases, such as MySQL, PostgreSQL, Cassandra, ClickHouse, ElasticSearch, OpenSearch and more, making it a powerful tool for cross-database performance comparisons. The tool provides extensive support for different data access patterns, including inserts, updates, facet searches, indexed searches, vector searches, and others, allowing for a detailed exploration of how each database handles different query types and workloads.
1616

1717
With built-in features for simulating multi-tenant environments, the benchmark can model real-world SaaS-like scenarios where multiple tenants access shared resources. Additionally, it offers advanced logging and diagnostic features that help developers and database administrators quickly identify and troubleshoot performance issues. The tool is ideal for assessing the impact of various database configurations, comparing the overhead of database clusters versus single instances, and analyzing performance bottlenecks under concurrent workloads. It also enables users to evaluate how databases perform under high-cardinality data, different indexing strategies, and various levels of hardware and virtualization environments. This makes it highly suitable for optimizing database systems and ensuring efficient performance in production-like environments.
1818

@@ -32,7 +32,6 @@ These instructions will get you a copy of the project up and running on your loc
3232

3333
Before you begin, ensure you have met the following requirements:
3434
* You have installed the latest version of [Go](https://golang.org/dl/).
35-
* You have a `<Mac/Linux/Windows>` machine. State which OS is supported/required.
3635

3736
### Getting perfkit
3837

acronis-db-bench/README.md

Lines changed: 142 additions & 122 deletions
Large diffs are not rendered by default.

acronis-db-bench/tenants-cache/tenant_generator.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,8 +559,9 @@ func (tc *TenantsCache) CreateTenant(rw *benchmark.RandomizerWorker, tx db.Datab
559559
return "", err
560560
}
561561

562+
var tenantUuid, _ = guuid.ParseBytes([]byte(t.UUID))
562563
if err = tx.BulkInsert(TableNameTenants, [][]interface{}{
563-
{t.ID, t.UUID, t.Name, t.Kind, t.ParentID, t.NestingLevel, t.IsDeleted, t.ParentHasAccess},
564+
{t.ID, tenantUuid, t.Name, t.Kind, t.ParentID, t.NestingLevel, t.IsDeleted, t.ParentHasAccess},
564565
}, []string{"id", "uuid", "name", "kind", "parent_id", "nesting_level", "is_deleted", "parent_has_access"}); err != nil {
565566
tc.logger.Log(benchmark.LogTrace, 0, fmt.Sprintf("error inserting into table %s: %v", TableNameTenants, err))
566567
return "", err
@@ -624,8 +625,9 @@ func (tc *TenantsCache) CreateCTIEntity(rw *benchmark.RandomizerWorker, tx db.Da
624625

625626
cti.GlobalState = 1
626627

628+
var ctiUUID, _ = guuid.ParseBytes([]byte(cti.UUID))
627629
if err = tx.BulkInsert(TableNameCtiEntities, [][]interface{}{
628-
{cti.UUID, cti.CTI, cti.Final, cti.GlobalState, cti.EntitySchema, cti.Annotations, cti.Traits, cti.TraitsSchema, cti.TraitsAnnotations},
630+
{ctiUUID, cti.CTI, cti.Final, cti.GlobalState, cti.EntitySchema, cti.Annotations, cti.Traits, cti.TraitsSchema, cti.TraitsAnnotations},
629631
}, []string{"uuid", "cti", "final", "global_state", "entity_schema", "annotations", "traits", "traits_schema", "traits_annotations"}); err != nil {
630632
return fmt.Errorf("error inserting into table %s: %v", TableNameCtiEntities, err)
631633
}

acronis-db-bench/tests.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func (t *TestDesc) getDBs() string {
105105

106106
var (
107107
// ALL is a list of all supported databases
108-
ALL = []db.DialectName{db.POSTGRES, db.MYSQL, db.MSSQL, db.SQLITE, db.CLICKHOUSE, db.CASSANDRA, db.ELASTICSEARCH}
108+
ALL = []db.DialectName{db.POSTGRES, db.MYSQL, db.MSSQL, db.SQLITE, db.CLICKHOUSE, db.CASSANDRA, db.ELASTICSEARCH, db.OPENSEARCH}
109109
// RELATIONAL is a list of all supported relational databases
110110
RELATIONAL = []db.DialectName{db.POSTGRES, db.MYSQL, db.MSSQL, db.SQLITE}
111111
// PMWSA is a list of all supported databases except ClickHouse

acronis-db-bench/workers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func initWorker(b *benchmark.Benchmark, workerID int, testDesc *TestDesc, rowsRe
3333
tenantCacheDBOpts.ConnString = b.TestOpts.(*TestOpts).BenchOpts.TenantConnString
3434

3535
if workerData.tenantsCache, err = NewDBConnector(&tenantCacheDBOpts, workerID, b.Logger, 1); err != nil {
36-
return
36+
b.Exit("db: cannot create tenants cache connection: %v", err)
3737
}
3838
}
3939

db/db.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const (
1919
CLICKHOUSE DialectName = "clickhouse" // CLICKHOUSE is the ClickHouse driver name
2020
CASSANDRA DialectName = "cassandra" // CASSANDRA is the Cassandra driver name
2121
ELASTICSEARCH DialectName = "elasticsearch" // ELASTICSEARCH is the Elasticsearch driver name
22+
OPENSEARCH DialectName = "opensearch" // OPENSEARCH is the OpenSearch driver name
2223
)
2324

2425
// Special conditions for searching
@@ -359,6 +360,7 @@ func GetDatabases() []DBType {
359360
// "A" is used as the latest symbol of the "Cassandra" due to duplicate with ClickHouse "C"
360361
ret = append(ret, DBType{Driver: CASSANDRA, Symbol: "A", Name: "Cassandra"})
361362
ret = append(ret, DBType{Driver: ELASTICSEARCH, Symbol: "E", Name: "Elasticsearch"})
363+
ret = append(ret, DBType{Driver: OPENSEARCH, Symbol: "O", Name: "OpenSearch"})
362364

363365
return ret
364366
}

db/es/adapter.go

Lines changed: 0 additions & 233 deletions
This file was deleted.

0 commit comments

Comments
 (0)