Skip to content

Commit

Permalink
[PLAT-14294] Query latency increase workloads
Browse files Browse the repository at this point in the history
  • Loading branch information
cdavid authored and anmalysh-yb committed Dec 12, 2024
1 parent d3dcc04 commit ade7834
Show file tree
Hide file tree
Showing 10 changed files with 1,035 additions and 20 deletions.
10 changes: 5 additions & 5 deletions src/main/java/com/yugabyte/sample/apps/AppBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public abstract class AppBase implements MetricsTracker.StatusMessageAppender {
public static final int NUM_KEYS_TO_READ_FOR_YSQL_AND_YCQL = 1500000;

// Variable to track start time of the workload.
private long workloadStartTime = -1;
protected long workloadStartTime = -1;
// Instance of the workload configuration.
public static AppConfig appConfig = new AppConfig();
// The configuration of the load tester.
Expand Down Expand Up @@ -428,8 +428,8 @@ public synchronized void resetClients() {
cassandra_session = null;
}

Random random = new Random();
byte[] buffer;
protected Random random = new Random();
protected byte[] buffer;
Checksum checksum = new Adler32();

// For binary values we store checksum in bytes.
Expand Down Expand Up @@ -852,7 +852,7 @@ public String appenderName() {
/**
* Close the Connection.
*/
static void close(Connection c) {
protected static void close(Connection c) {
if (c != null) {
try {
c.close();
Expand All @@ -865,7 +865,7 @@ static void close(Connection c) {
/**
* Close the PreparedStatement.
*/
static void close(PreparedStatement ps) {
protected static void close(PreparedStatement ps) {
if (ps != null) {
try {
ps.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* which is indexed.
*/
public class CassandraInserts extends CassandraKeyValue {
private static final Logger LOG = Logger.getLogger(CassandraSecondaryIndex.class);
private static final Logger LOG = Logger.getLogger(CassandraInserts.class);

static {
appConfig.readIOPSPercentage = -1;
Expand Down
9 changes: 3 additions & 6 deletions src/main/java/com/yugabyte/sample/apps/CassandraKeyValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,18 @@
import java.util.Arrays;
import java.util.List;

import com.datastax.driver.core.BoundStatement;
import com.datastax.driver.core.PreparedStatement;
import com.datastax.driver.core.ResultSet;
import com.datastax.driver.core.Row;
import org.apache.log4j.Logger;

import com.yugabyte.sample.common.SimpleLoadGenerator.Key;
import com.datastax.driver.core.BoundStatement;
import com.datastax.driver.core.PreparedStatement;

/**
* This workload writes and reads some random string keys from a CQL server. By default, this app
* inserts a million keys, and reads/updates them indefinitely.
*/
public class CassandraKeyValue extends CassandraKeyValueBase {

private static final Logger LOG = Logger.getLogger(CassandraKeyValueBase.class);
private static final Logger LOG = Logger.getLogger(CassandraKeyValue.class);
// The default table name to create and use for CRUD ops.
private static final String DEFAULT_TABLE_NAME = CassandraKeyValue.class.getSimpleName();
static {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* which is indexed.
*/
public class CassandraUniqueSecondaryIndex extends CassandraSecondaryIndex {
private static final Logger LOG = Logger.getLogger(CassandraSecondaryIndex.class);
private static final Logger LOG = Logger.getLogger(CassandraUniqueSecondaryIndex.class);

// The default table name to create and use for CRUD ops.
private static final String DEFAULT_TABLE_NAME =
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/yugabyte/sample/apps/SqlDataLoad.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* Then runs a write workload to load data into the target table.
*/
public class SqlDataLoad extends AppBase {
private static final Logger LOG = Logger.getLogger(SqlInserts.class);
private static final Logger LOG = Logger.getLogger(SqlDataLoad.class);

// Static initialization of this workload's config. These are good defaults for getting a decent
// read dominated workload on a reasonably powered machine. Exact IOPS will of course vary
Expand Down
Loading

0 comments on commit ade7834

Please sign in to comment.