sysbench scripts (13)
来源:互联网 发布:mac邮件登录qq邮箱 编辑:程序博客网 时间:2024/06/06 17:09
衔接上文,以下是analyze文件夹下的脚本。
13、analyze_innodb_log_flushed_fallbehind.sh脚本
#! /bin/sh############################################################ Copyright (c) 2012, Heng.Wang. All rights reserved.## This program is used to analyze the dirty pages ratio.############################################################ set -x# Get the key value of input arguments format like '--args=value'.get_key_value(){ echo "$1" | sed 's/^--[a-zA-Z_-]*=//' }# Usage will be helpful when you need to input the valid arguments.usage(){cat <<EOFUsage: $0 [configure-options] -?, --help Show this help message. --input=<> Set the input file path. --outputdir=<> Set the output directory. Note: this script is intended for internal use by developers.EOF}# Print the default value of the arguments of the script.print_default(){cat <<EOF The default value of the variables: input $INPUT outputdir $OUTPUTDIREOF}# Parse the input arguments and get the value of the input argument.parse_options(){ while test $# -gt 0 do case "$1" in --input=*) INPUT=`get_key_value "$1"`;; --outputdir=*) OUTPUTDIR=`get_key_value "$1"`;; -? | --help) usage print_default exit 0;; *) echo "Unknown option '$1'" exit 1;; esac shift done}#################################################################INPUT=""OUTPUTDIR=/opt/resultparse_options "$@"if [ -z $INPUT ]then echo "Please give the input file address!" exit -1fiif [ -f $INPUT ]then [[ -d $OUTPUTDIR ]] || mkdir -p $OUTPUTDIR dir1=`dirname $INPUT` dir2=`dirname $dir1` cat $INPUT | awk ' BEGIN { } /Log sequence number/ {st=$4 } /Log flushed up to/ \ { ed=$5; print (st-ed) } ' > $OUTPUTDIR/log_flushed_fallbehind_${dir2##*/}_${dir1##*/}.resultelse echo "The input file is not exist!" echo "Please be double check the input file!" exit -1fi
- sysbench scripts (13)
- Sysbench scripts使用说明文档
- Sysbench scripts源码分析
- sysbench scripts (1)
- sysbench scripts (2)
- sysbench scripts (3)
- sysbench scripts (4)
- sysbench scripts (5)
- sysbench scripts (6)
- sysbench scripts (7)
- sysbench scripts (8)
- sysbench scripts (9)
- sysbench scripts (10)
- sysbench scripts (11)
- sysbench scripts (12)
- sysbench scripts (14)
- sysbench scripts (15)
- sysbench
- JavaScript文件引用JavaScript文件的方法
- DHCP 和DHCP failover 扫盲
- C++箴言:接口继承和实现继承
- sysbench scripts (11)
- sysbench scripts (12)
- sysbench scripts (13)
- [Windows]: 启动C:\PROGRA~1\ThinkPad\UTILIT~1\PWMTR32V.DLL时出现问题
- web项目测试方法总结 .
- ant import relative path
- 黑马程序员--什么是javaBean?
- FB推出App Center背后的秘密
- sql 调优-sql 的limit
- a simple shell script for ftp
- 车载系统的相关功能