Skip to content

Commit

Permalink
CAD-1073 bench | db-sync: more precise verbosity settings
Browse files Browse the repository at this point in the history
  • Loading branch information
deepfire committed Jul 1, 2020
1 parent 225724a commit edf442f
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 49 deletions.
10 changes: 1 addition & 9 deletions bench/bench.sh
Expand Up @@ -248,14 +248,6 @@ main() {
call ) "$@";;
* ) usage; exit 1;; esac
}
trap atexit EXIT
trap atexit SIGHUP
trap atexit SIGINT
trap atexit SIGTERM
trap atexit SIGQUIT
atexit() {
true # pkill -f "tee ${batch_log}"
}

###
### Top-level operations
Expand Down Expand Up @@ -345,7 +337,7 @@ op_bench_start() {
oprint "waiting ${generator_startup_delay}s for the nodes to establish business.."
sleep ${generator_startup_delay}

tag=$(generate_run_id "${prof}")
tag=$(generate_run_tag "${prof}")
dir="./runs/${tag}"
oprint "creating new run: ${tag}"
op_register_new_run "${prof}" "${tag}" "${deploylog}"
Expand Down
30 changes: 21 additions & 9 deletions bench/lib-benchrun.sh
@@ -1,14 +1,26 @@
#!/usr/bin/env bash

generate_run_id() {
local prof="$1" node tx l tps io blks
node=$(jq --raw-output '.["cardano-node"].rev' nix/sources.bench-txgen-simple.json | cut -c-8)
tx=$(profjq "${prof}" .generator.tx_count)
l=$(profjq "${prof}" .generator.add_tx_size)
io=$(profjq "${prof}" .generator.inputs_per_tx)
tps=$(profjq "${prof}" .generator.tps)
blks=$(($(profjq "${prof}" .genesis.max_block_size) / 1000))
echo "$(generate_mnemonic).node-${node}.tx${tx}.l${l}.tps${tps}.io${io}.blk${blks}"
generate_run_tag() {
local prof=$1

echo "$(date +'%Y'-'%m'-'%d'-'%H.%M').$prof"
}

run_report_name() {
local metafile meta prof suffix=
dir=${1:-.}
metafile="$dir"/meta.json
meta=$(jq .meta "$metafile" --raw-output)
prof=$(jq .profile <<<$meta --raw-output)
date=$(date +'%Y'-'%m'-'%d'-'%H.%M' --date=@"$(jq .timestamp <<<$meta)")

test -n "$meta" -a -n "$prof" ||
fail "Bad run meta.json format: $metafile"

if is_run_broken "$dir"
then suffix='broken'; fi

echo "$date.$prof${suffix:+.$suffix}"
}

run_fetch_benchmarking() {
Expand Down
17 changes: 0 additions & 17 deletions bench/lib-report.sh
Expand Up @@ -23,23 +23,6 @@ patch_run() {
fi
}

run_report_name() {
local metafile meta prof suffix=
dir=${1:-.}
metafile="$dir"/meta.json
meta=$(jq .meta "$metafile" --raw-output)
prof=$(jq .profile <<<$meta --raw-output)
date=$(date +'%Y'-'%m'-'%d'-'%H.%M' --date=@"$(jq .timestamp <<<$meta)")

test -n "$meta" -a -n "$prof" ||
fail "Bad run meta.json format: $metafile"

if is_run_broken "$dir"
then suffix='broken'; fi

echo "$date.$prof${suffix:+.$suffix}"
}

package_run() {
local tag report_name package
dir=${1:-.}
Expand Down
40 changes: 26 additions & 14 deletions globals-bench-txgen-simple.nix
@@ -1,4 +1,5 @@
pkgs:
with pkgs.lib;
let
benchmarkingParamsFile = ./benchmarking-cluster-params.json;
benchmarkingParams =
Expand Down Expand Up @@ -56,9 +57,6 @@ let
rpKeepFilesNum = 20;
}; }
];
minSeverity = "Debug";
TracingVerbosity = "MaximalVerbosity";
TurnOnLogMetrics = true;
options = {
mapBackends = {
"cardano.node-metrics" = [ "KatipBK" ];
Expand Down Expand Up @@ -122,7 +120,7 @@ in reportDeployment (rec {
preStart = ''
'';
serviceConfig = {
ExecStartPre = pkgs.lib.mkForce
ExecStartPre = mkForce
("+" + pkgs.writeScript "cardano-db-sync-prestart" ''
#!/bin/sh
set -xe
Expand All @@ -137,22 +135,36 @@ in reportDeployment (rec {
};
})
];
services.cardano-graphql.enable = pkgs.lib.mkForce false;
services.graphql-engine.enable = pkgs.lib.mkForce false;
services.cardano-graphql.enable = mkForce false;
services.graphql-engine.enable = mkForce false;
services.cardano-db-sync = {
logConfig =
pkgs.iohkNix.cardanoLib.defaultExplorerLogConfig
// benchmarkingLogConfig "db-sync";
recursiveUpdate
pkgs.iohkNix.cardanoLib.defaultExplorerLogConfig
(recursiveUpdate
(benchmarkingLogConfig "db-sync")
{
options.mapSeverity = {
"db-sync-node.Subscription" = "Error";
"db-sync-node.Mux" = "Error";
"db-sync-node" = "Info";
};
});
};
};
coreNodes = map (n : n // {
services.cardano-node.nodeConfig =
pkgs.globals.environmentConfig.nodeConfig
// benchmarkingLogConfig "node"
// {
PBftSignatureThreshold =
(1.0 / __length benchmarkingTopology.coreNodes) * 1.5;
};
recursiveUpdate
pkgs.globals.environmentConfig.nodeConfig
(recursiveUpdate
(benchmarkingLogConfig "node")
{
TracingVerbosity = "MaximalVerbosity";
minSeverity = "Debug";
TurnOnLogMetrics = true;
PBftSignatureThreshold =
(1.0 / __length benchmarkingTopology.coreNodes) * 1.5;
});
}) (benchmarkingTopology.coreNodes or []);
};

Expand Down

0 comments on commit edf442f

Please sign in to comment.