-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tweaking the current_connections metric
This patch excludes connections owned by either sockpool or the in-process cache from the current_connections metric. This is one of the metrics that we use internally to monitor database capacity. Since it is very little overhead for libevent based network to maintain idle connections, it makes sense to exclude donated connections from the metric. Signed-off-by: Rivers Zhang <hzhang320@bloomberg.net>
- Loading branch information
1 parent
f901f4a
commit ff357ba
Showing
7 changed files
with
49 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env bash | ||
|
||
DB=$1 | ||
default=default | ||
cdb2sql=cdb2sql | ||
set -e | ||
|
||
hostflags= | ||
|
||
if [[ -n "$CLUSTER" ]]; then | ||
read -ra nodes <<< "$CLUSTER" | ||
hostflags="--host ${nodes[0]}" | ||
fi | ||
|
||
|
||
sql='SELECT SLEEP(2)' | ||
for i in $(seq 1 10); do | ||
$cdb2sql ${CDB2_OPTIONS} $hostflags $DB $default "$sql" & | ||
done | ||
|
||
wait | ||
|
||
n=`$cdb2sql --tabs ${CDB2_OPTIONS} $hostflags $DB $default "SELECT value FROM comdb2_metrics WHERE name='current_connections'"` | ||
if [[ $n -ne 1 ]]; then | ||
echo current_connections $n >&2 | ||
exit 1 | ||
fi | ||
|
||
echo $(basename $0) success | ||
exit 0 |