Files
Matthew Little f5c4da7b87 feat: [CPU optimizations] use native rust module for decoding Clarity values, binary transaction blobs, post-condition binary blobs, Stacks addresses (#1094)
* feat: use native nodejs addon module for Stacks binary encoding and decoding (Clarity values, binary wire formats, addresses, etc)

* refactor: move transaction, post-condition, and clarity value decoding from js to native addon

* chore: fix rosetta pox contract-call parsing

* chore: use npm registry for stacks-encoding-native-js

* chore: fix unused export

* chore: commit dev file to be converted to unit tests

* refactor: use stacks-encoding-native lib for stacks-address operations

* chore: bump stacks-encoding-native lib

* chore: stacks-native-encoding version bump with fix for decoding multisig tx sender address

* chore: stacks-native-encoding version bump with fix for decoding zero-length prefixed contract call args

* test: introduce tests for on-btc-chain originating stx tx processing

* chore: prettier ignore json payload sample files

* chore: clear up type import syntax

* test: tests for on-btc-chain originating stx-lock tx processing

* feat: expand cpu profiling capabilties with distinct start and stop endpoints easier to use in scripts

* chore: fix compilation error in /utils

* feat: support for performing cpu profiling with the native addon

* fix: avoid re-injecting sourcemap support when running with ts-node

* chore: updates for latest stacks-native-encoding library function usage, only decode clarity value type signatures when needed

* chore: decode only clarity value repr string rather than deep value in several areas

* chore: fix package-lock.json

* feat: commit load testing script with sampled endpoint list

* chore: fix synthetic-stx-txs-tests

* chore: update to latest stacks-encoding-native types (using hex strings rather than js buffers)

* chore: bump stacks-encoding-native version

* chore: fix regular integration tests

* chore: fix bug with rosetta principal repr parsing

* chore: bump stacks-encoding-native version

* chore: add several TODO(perf) comments where buffers should be hex strings

* chore: remove stacks-native-encoding debug code that have since been converted into unit tests

* chore: remove debug code

* fix: bug fix for reverse file stream bug if read chunk starts with line-ending

* chore: wrap synthetic stx txs tests
2022-04-13 18:51:33 +02:00

40 lines
882 B
Bash
Executable File

#!/bin/bash
echo "Reading from $1"
line_count=$(cat $1 | wc -l | tr -d ' ')
req_count=0
echo "Total endpoints: $line_count lines"
hostname="http://127.0.0.1"
port="3998"
profile_port="9119"
host="$hostname:$port"
curl "$hostname:$profile_port/profile/cpu/start" || {
echo "CPU profiler request failed"
exit 1
}
while read i
do
((req_count=req_count+1))
if [[ $i == "/extended/v1/tokens/"* ]]
then
echo "Skipping $i"
else
percent=$(bc <<< "scale=3; $req_count / $line_count * 100")
echo "Completed $req_count / $line_count, $percent%, hitting $i"
curl --silent --output /dev/null --fail "$host$i" || {
echo "Request failed to endpoint: $host$i"
exit 1
}
fi
done < $1
curl -OJ "$hostname:$profile_port/profile/cpu/stop" || {
echo "CPU profiler output request failed"
exit 1
}