Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop 3.0 #228

Draft
wants to merge 15 commits into
base: develop-3.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tests/
/rel/basho_bench
package
.rebar
rebar.lock
*~
#*#
.DS_Store
38 changes: 38 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
image: docker:stable

services:
- docker:dind

variables:
CONTAINER_IMAGE: registry.gitlab.com/$CI_PROJECT_PATH
DOCKER_TLS_CERTDIR: ""
DOCKER_HOST: tcp://localhost:2375
DOCKER_DRIVER: overlay2

before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
- apk add --update curl && rm -rf /var/cache/apk/*

stages:
- build
- benchmark

build:
stage: build
script:
- docker pull $CONTAINER_IMAGE/$CI_COMMIT_REF_NAME:latest || true
- docker build
--cache-from $CONTAINER_IMAGE/$CI_COMMIT_REF_NAME:latest
--tag $CONTAINER_IMAGE/$CI_COMMIT_REF_NAME:$CI_COMMIT_SHA
--tag $CONTAINER_IMAGE/$CI_COMMIT_REF_NAME:latest
--build-arg deployment=$CI_COMMIT_REF_NAME
.
- docker push $CONTAINER_IMAGE/$CI_COMMIT_REF_NAME:$CI_COMMIT_SHA
- docker push $CONTAINER_IMAGE/$CI_COMMIT_REF_NAME:latest

benchmark:
stage: benchmark
script:
- set -x
- docker pull $CONTAINER_IMAGE/$CI_COMMIT_REF_NAME:latest || true
- docker run -it $CONTAINER_IMAGE/$CI_COMMIT_REF_NAME:latest
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM erlang:20-alpine
ARG deployment
ADD . /srv/basho_bench
WORKDIR /srv/basho_bench
RUN rebar3 do upgrade, compile, escriptize

26 changes: 26 additions & 0 deletions examples/pointzi-crdt-map.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{mode,{rate,max}}.
{duration,20}.
{concurrent,200}.
{rng_seed,now}.

%% This bucket type must be created and set to be datatype, maps.
%%{riakc_pb_bucket,{<<"TagsTest">>,<<"TagsTestBucket">>}}.
{riakc_pb_bucket,{<<"Log">>,<<"InstallLogTest">>}}.

{key_generator, {uniform_int, 100}}.
{value_generator, {uniform_int, 1000}}.

{operations,[{{game,completed},10},
{{team,player,addition},3},
{{team,player,removal},3},
{{team,read},100},
{{team,write},1}]}.

{riakc_pb_ips,[
{"localhost",8087}
%%{"13.0.6.35",8087}
]}.

{riakc_pb_replies,default}.

{driver,basho_bench_driver_riakc_pb}.
67 changes: 67 additions & 0 deletions pointzi.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{mode, max}.

{duration, 1}.

{concurrent, 1}.

{driver, basho_bench_driver_https_streethawk}.
%% Default generators, reference by the atoms key_generator and value_generator
{key_generator, uuid_v4}.
{value_generator, {fixed_bin, 10000}}.

%%% Generators: {Name, KeyGen | ValGen}
% Name: atom()
% KeyGen: User or Basho Bench defined key generator
% ValGen: User or Basho Bench defined value generator
{generators, [
{string_g, {key_generator, {int_to_str, {uniform_int, 50000}}}},
{binstring_g, {value_generator, {fixed_bin, 100}}},
{install_g, {value_generator, {function, pointzi, generate_install, []}}}
]}.

%%% Values: {Name, Value}
%%% {Name, {FormattedValue, Generators}}
% Name: atom()
% Value: string() | atom() - named generator, can be key_generator or value_generator for default
% FormattedValue: string() - formatted with io_lib:format
% Generators: list() - list of generators, can be key_generator or value_generator for default
{values, [
{json_v, install_g}
]}.

%%% Headers: {Name, Headers}
% Name: atom()
% Headers: proplist()
{headers, [
{json_h, [{"Content-Type", "application/json"}, {"Accept", "application/json"}]}
]}.

%%% Targets: {Name, {Host, Port, Path}}
%%% {Name, [{Host1, Port1, Path1},{Host2, Port2, Path2},...]}
%%% {Name, {Host, Port, {FormattedPath, Generators}}}
%%% {Name, [{Host1, Port1, {FormattedPath1, Generators1}},{Host2, Port2, {FormattedPath2, Generators2}},...]}
% Name: atom()
% Host: string()
% Port: integer()
% Path: string()
% FormattedPath: string() - formatted with io_lib:format
% Generators: list() - list of generators, can be key_generator or value_generator for default
{targets, [
%{installs_uri_t, {"localhost", 8000, "/v3/installs"}}
{installs_uri_t, {"https://george.pointzi.com", 443, "/v3/installs"}}
]}.

%%% Operations: {{get|delete, Target}, Weight}
%%% {{get|delete, Target, Header}, Weight}
%%% {{put|post, Target, Value}, Weight}
%%% {{put|post, Target, Value, Header}, Weight}
% Target: atom() - defined target
% Header: atom() - defined header
% Value: atom() - defined value
% Weight: integer() - ratio of this operation to the rest (ThisWeight / TotalWeightSum = % of this Operation)

{operations, [
%% Get without a key
%%{{get, base_uri_t}, 1},
{{post, installs_uri_t, json_v, json_h}, 1}
]}.
2 changes: 2 additions & 0 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
eleveldb
]}.

{escript_main_app, basho_bench}.

%% When using the Java client bench driver, please use the -N and -C
%% command line options to set the distributed Erlang node name
%% and node cookie for the basho_bench VM.
Expand Down
2 changes: 1 addition & 1 deletion src/basho_bench.erl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ main(Args) ->
CrashLog = filename:join([TestDir, "crash.log"]),
application:set_env(lager,
handlers,
[{lager_console_backend, ConsoleLagerLevel},
[{lager_console_backend, [{level, ConsoleLagerLevel}]},
{lager_file_backend, [{file, ErrorLog}, {level, error}, {size, 10485760}, {date, "$D0"}, {count, 5}]},
{lager_file_backend, [{file, ConsoleLog}, {level, debug}, {size, 10485760}, {date, "$D0"}, {count, 5}]}
]),
Expand Down
Loading