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
#!/bin/sh | |
# if you about to exeute some tests make sure to clear the logs before.. | |
#systemctl stop ovirt-engine; echo "" > /var/log/ovirt-engine/engine.log; systemctl start ovirt-engine; | |
echo "==== engine error rate ====" | |
echo "JdbcConnectionException - $(grep -c CannotGetJdbcConnectionException /var/log/ovirt-engine/engine.log)" | |
echo "Tasks rejected - $(grep -c reject /var/log/ovirt-engine/engine.log)" | |
echo "heartbeat exceeded - $(grep -c 'Heartbeat exceeded' /var/log/ovirt-engine/engine.log)" | |
echo "VM not responding - $(grep -c 'VM_NOT_RESPONDING' /var/log/ovirt-engine/engine.log)" |
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
#!/bin/sh | |
# if you about to exeute some tests make sure to clear the logs before.. | |
#systemctl stop ovirt-engine; echo "" > /var/log/ovirt-engine/engine.log; systemctl start ovirt-engine; | |
# usage: | |
#nohup ./stats_err.sh > /dev/null 2>&1 & | |
while true; do | |
echo "$(grep -c CannotGetJdbcConnectionException /var/log/ovirt-engine/engine.log)" > /tmp/JdbcConnectionException.log |
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
#!/bin/sh | |
case "$1" in | |
'heap-used') | |
/opt/rh/eap7/root/usr/share/wildfly/bin/jboss-cli.sh --connect --controller=localhost:8706 --user=admin@internal --password=qum5net --command="/core-service=platform-mbean/type=memory:read-attribute(name=heap-memory-usage)" |grep used | awk '{print $3/1024/1024 }' | sed 's/L,//' | |
;; | |
'heap-init') | |
/opt/rh/eap7/root/usr/share/wildfly/bin/jboss-cli.sh --connect --controller=localhost:8706 --user=admin@internal --password=qum5net --command="/core-service=platform-mbean/type=memory:read-attribute(name=heap-memory-usage)" |grep init | awk '{print $3/1024/1024 }' | sed 's/L,//' | |
;; | |
'heap-committed') |
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
#!/bin/sh | |
# the following script simply testing an SQL for simulatnusly execution. | |
# usage: ./psql-simulatnusly-hits.sh test "SELECT EXTRACT(DECADE FROM TIMESTAMP '2017-05-01 20:00:00');" | |
db=$1 | |
sql=$2 | |
parallel=$3 | |
# TODO: add statistics. |
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
#! /bin/sh | |
# yet another simple framework to test system calls, sh scripts. | |
cmd=$1 # a command to run. | |
parallel=$2 # how many. | |
frequency=$3 # how often generate instance | |
pool=$4 # running command in certain pool size. | |
pool_sleep_time=$5 # how long to wait for a pool to be done. |
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
import ovirtsdk4 | |
import time | |
api = ovirtsdk4.Connection('https://<server>/ovirt-engine/api', 'admin@internal', '<pass>', | |
True, compress=True, debug=False, log=False) | |
def gettime(cap=None): | |
start = time.time() | |
api.system_service().hosts_service().list(max=cap) | |
if cap is None: | |
print 'list size cap {0} response time {1}'.format(len(api.system_service().hosts_service().list(max=cap)), time.time() - start) |
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
oc project kube-system | |
oc get all --all-namespaces|egrep 'prom|alert'|awk '{print $2}'|grep [a-z]|xargs oc delete | |
oc get configmaps|grep prom|awk '{print $1}' | xargs oc delete configmaps | |
oc get secrets|egrep 'prom|alert'|awk '{print $1}' | xargs oc delete secrets | |
oc delete sa prometheus | |
oc delete clusterrolebindings prometheus-cluster-reader | |
oc new-app -f prometheus.yaml |
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
#!/bin/bash | |
# | |
# usage ./jvm_collector.sh <container name> <interval> | |
container_name=$1 | |
interval=$2 | |
# get jvm pid | |
jpid=$(docker exec -ti `docker ps --filter name=$container_name --format "{{.Names}}"` ps -ef |grep java |grep -v grep |awk '{print $2}') | |
while true; do |
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
ps -eo pid,cmd,cgroup |grep java |grep -v 'user.slice' |awk '{print $1}' |
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
while true; | |
do | |
echo "$(date +'%m-%d-%y-%H:%M:%S') $(oc exec prometheus-k8s-0 -n openshift-monitoring -c prometheus -- df |grep -v tmp |grep '/prometheus')" >> ~/pvc_monitor_0.log | |
echo "$(date +'%m-%d-%y-%H:%M:%S') $(oc exec prometheus-k8s-1 -n openshift-monitoring -c prometheus -- df |grep -v tmp |grep '/prometheus')" >> ~/pvc_monitor_1.log | |
sleep 15 | |
done | |
exit 0 |
OlderNewer