Sha256: ef4e74a4097bb8cfa3feff5338727788928cd42a638b2068f74b2c4de19770ac

Contents?: true

Size: 748 Bytes

Versions: 15

Compression:

Stored size: 748 Bytes

Contents

CREATE OR REPLACE FUNCTION benchmark_write(
  stream_name varchar,
  cycles int DEFAULT 1000
)
RETURNS void
AS $$
BEGIN
  RAISE NOTICE 'ยป benchmark_write';
  RAISE NOTICE 'stream_name: %', benchmark_write.stream_name;
  RAISE NOTICE 'cycles: %', benchmark_write.cycles;

  FOR i IN 1..cycles LOOP
    IF current_setting('message_store.debug_benchmark', true) = 'on' OR current_setting('message_store.debug', true) = 'on' THEN
      RAISE NOTICE '%', i;
    END IF;

    PERFORM write_message(gen_random_uuid()::varchar, stream_name::varchar, 'SomeType'::varchar, '{"attribute": "some value"}'::jsonb, '{"metaAttribute": "some meta value", "correlationStreamName": "someCorrelation-123"}'::jsonb);
  END LOOP;
END;
$$ LANGUAGE plpgsql
VOLATILE;



Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
message-db-2.1.6 database/benchmark_write.sql
message-db-2.1.5 database/benchmark_write.sql
message-db-2.1.4 database/benchmark_write.sql
message-db-2.1.3 database/benchmark_write.sql
message-db-2.1.2 database/benchmark_write.sql
message-db-2.1.1 database/benchmark_write.sql
message-db-2.1.0 database/benchmark_write.sql
message-db-2.0.2 database/benchmark_write.sql
message-db-2.0.1 database/benchmark_write.sql
message-db-2.0.0 database/benchmark_write.sql
message-db-1.1.3 database/benchmark_write.sql
message-db-1.1.2 database/benchmark_write.sql
message-db-1.1.1 database/benchmark_write.sql
message-db-1.1.0 database/benchmark_write.sql
message-db-1.0.0 database/benchmark_write.sql