zabbix 监控ssdb
zabbix 的啥基础知识啥的,请看由本站大牛凉白开先生写的zabbix教程。这里说说如何监控ssdb。SSDB 是一个 C/C++ 语言开发的高性能 NoSQL 数据库, 支持 KV, list, map(hash), zset(sorted set) 等数据结构, 用来替代或者与 Redis 配合存储十亿级别列表的数据。
百牛信息技术bainiu.ltd整理发布到博客园
- 导入ssdb模板
这个是我自己创建的。不合适的地方自行修改。123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792<?xml version="1.0" encoding="UTF-8"?><zabbix_export><version>3.2</version><date>2017-07-05T06:50:33Z</date><groups><group><name>Templates</name></group></groups><templates><template><template>Template App SSDB</template><name>Template App SSDB</name><description>ssdb</description><groups><group><name>Templates</name></group></groups><applications><application><name>ssdb</name></application></applications><items><item><name>ssdb server is running</name><type>0</type><snmp_community/><multiplier>0</multiplier><snmp_oid/><key>net.tcp.listen[{$SSDB.PORT}]</key><delay>30</delay><history>90</history><trends>365</trends><status>0</status><value_type>3</value_type><allowed_hosts/><units/><delta>0</delta><snmpv3_contextname/><snmpv3_securityname/><snmpv3_securitylevel>0</snmpv3_securitylevel><snmpv3_authprotocol>0</snmpv3_authprotocol><snmpv3_authpassphrase/><snmpv3_privprotocol>0</snmpv3_privprotocol><snmpv3_privpassphrase/><formula>1</formula><delay_flex/><params/><ipmi_sensor/><data_type>0</data_type><authtype>0</authtype><username/><password/><publickey/><privatekey/><port/><description/><inventory_link>0</inventory_link><applications><application><name>ssdb</name></application></applications><valuemap><name>Service state</name></valuemap><logtimefmt/></item><item><name>ssdb $1</name><type>0</type><snmp_community/><multiplier>0</multiplier><snmp_oid/><key>ssdb[available]</key><delay>30</delay><history>90</history><trends>365</trends><status>0</status><value_type>3</value_type><allowed_hosts/><units/><delta>0</delta><snmpv3_contextname/><snmpv3_securityname/><snmpv3_securitylevel>0</snmpv3_securitylevel><snmpv3_authprotocol>0</snmpv3_authprotocol><snmpv3_authpassphrase/><snmpv3_privprotocol>0</snmpv3_privprotocol><snmpv3_privpassphrase/><formula>1</formula><delay_flex/><params/><ipmi_sensor/><data_type>0</data_type><authtype>0</authtype><username/><password/><publickey/><privatekey/><port/><description/><inventory_link>0</inventory_link><applications><application><name>ssdb</name></application></applications><valuemap><name>Service state</name></valuemap><logtimefmt/></item><item><name>ssdb $1 max_seq</name><type>0</type><snmp_community/><multiplier>0</multiplier><snmp_oid/><key>ssdb[binlogs]</key><delay>30</delay><history>90</history><trends>365</trends><status>0</status><value_type>3</value_type><allowed_hosts/><units/><delta>0</delta><snmpv3_contextname/><snmpv3_securityname/><snmpv3_securitylevel>0</snmpv3_securitylevel><snmpv3_authprotocol>0</snmpv3_authprotocol><snmpv3_authpassphrase/><snmpv3_privprotocol>0</snmpv3_privprotocol><snmpv3_privpassphrase/><formula>1</formula><delay_flex/><params/><ipmi_sensor/><data_type>0</data_type><authtype>0</authtype><username/><password/><publickey/><privatekey/><port/><description>The maximum binlog number in the current queue</description><inventory_link>0</inventory_link><applications><application><name>ssdb</name></application></applications><valuemap/><logtimefmt/></item><item><name>ssdb $1</name><type>0</type><snmp_community/><multiplier>0</multiplier><snmp_oid/><key>ssdb[dbsize]</key><delay>30</delay><history>90</history><trends>365</trends><status>0</status><value_type>3</value_type><allowed_hosts/><units/><delta>0</delta><snmpv3_contextname/><snmpv3_securityname/><snmpv3_securitylevel>0</snmpv3_securitylevel><snmpv3_authprotocol>0</snmpv3_authprotocol><snmpv3_authpassphrase/><snmpv3_privprotocol>0</snmpv3_privprotocol><snmpv3_privpassphrase/><formula>1</formula><delay_flex/><params/><ipmi_sensor/><data_type>0</data_type><authtype>0</authtype><username/><password/><publickey/><privatekey/><port/><description/><inventory_link>0</inventory_link><applications><application><name>ssdb</name></application></applications><valuemap/><logtimefmt/></item><item><name>ssdb links</name><type>0</type><snmp_community/><multiplier>0</multiplier><snmp_oid/><key>ssdb[links]</key><delay>30</delay><history>90</history><trends>365</trends><status>0</status><value_type>3</value_type><allowed_hosts/><units/><delta>0</delta><snmpv3_contextname/><snmpv3_securityname/><snmpv3_securitylevel>0</snmpv3_securitylevel><snmpv3_authprotocol>0</snmpv3_authprotocol><snmpv3_authpassphrase/><snmpv3_privprotocol>0</snmpv3_privprotocol><snmpv3_privpassphrase/><formula>1</formula><delay_flex/><params/><ipmi_sensor/><data_type>0</data_type><authtype>0</authtype><username/><password/><publickey/><privatekey/><port/><description/><inventory_link>0</inventory_link><applications><application><name>ssdb</name></application></applications><valuemap/><logtimefmt/></item><item><name>ssdb $1 $2</name><type>0</type><snmp_community/><multiplier>0</multiplier><snmp_oid/><key>ssdb[replication.client,last_seq]</key><delay>30</delay><history>90</history><trends>365</trends><status>0</status><value_type>3</value_type><allowed_hosts/><units/><delta>0</delta><snmpv3_contextname/><snmpv3_securityname/><snmpv3_securitylevel>0</snmpv3_securitylevel><snmpv3_authprotocol>0</snmpv3_authprotocol><snmpv3_authpassphrase/><snmpv3_privprotocol>0</snmpv3_privprotocol><snmpv3_privpassphrase/><formula>1</formula><delay_flex/><params/><ipmi_sensor/><data_type>0</data_type><authtype>0</authtype><username/><password/><publickey/><privatekey/><port/><description/><inventory_link>0</inventory_link><applications><application><name>ssdb</name></application></applications><valuemap/><logtimefmt/></item><item><name>ssdb $1 $2</name><type>0</type><snmp_community/><multiplier>0</multiplier><snmp_oid/><key>ssdb[replication.client,status]</key><delay>30</delay><history>90</history><trends>0</trends><status>0</status><value_type>4</value_type><allowed_hosts/><units/><delta>0</delta><snmpv3_contextname/><snmpv3_securityname/><snmpv3_securitylevel>0</snmpv3_securitylevel><snmpv3_authprotocol>0</snmpv3_authprotocol><snmpv3_authpassphrase/><snmpv3_privprotocol>0</snmpv3_privprotocol><snmpv3_privpassphrase/><formula>1</formula><delay_flex/><params/><ipmi_sensor/><data_type>0</data_type><authtype>0</authtype><username/><password/><publickey/><privatekey/><port/><description/><inventory_link>0</inventory_link><applications><application><name>ssdb</name></application></applications><valuemap/><logtimefmt/></item><item><name>ssdb $1</name><type>0</type><snmp_community/><multiplier>0</multiplier><snmp_oid/><key>ssdb[total_calls]</key><delay>30</delay><history>90</history><trends>365</trends><status>0</status><value_type>3</value_type><allowed_hosts/><units/><delta>0</delta><snmpv3_contextname/><snmpv3_securityname/><snmpv3_securitylevel>0</snmpv3_securitylevel><snmpv3_authprotocol>0</snmpv3_authprotocol><snmpv3_authpassphrase/><snmpv3_privprotocol>0</snmpv3_privprotocol><snmpv3_privpassphrase/><formula>1</formula><delay_flex/><params/><ipmi_sensor/><data_type>0</data_type><authtype>0</authtype><username/><password/><publickey/><privatekey/><port/><description/><inventory_link>0</inventory_link><applications><application><name>ssdb</name></application></applications><valuemap/><logtimefmt/></item></items><discovery_rules><discovery_rule><name>SSDB cmd discovery</name><type>0</type><snmp_community/><snmp_oid/><key>ssdb.cmd.discovery</key><delay>30</delay><status>0</status><allowed_hosts/><snmpv3_contextname/><snmpv3_securityname/><snmpv3_securitylevel>0</snmpv3_securitylevel><snmpv3_authprotocol>0</snmpv3_authprotocol><snmpv3_authpassphrase/><snmpv3_privprotocol>0</snmpv3_privprotocol><snmpv3_privpassphrase/><delay_flex/><params/><ipmi_sensor/><authtype>0</authtype><username/><password/><publickey/><privatekey/><port/><filter><evaltype>0</evaltype><formula/><conditions/></filter><lifetime>30</lifetime><description/><item_prototypes><item_prototype><name>ssdb cmd $1 $2</name><type>0</type><snmp_community/><multiplier>0</multiplier><snmp_oid/><key>ssdb[{#SSDBCMD},calls]</key><delay>30</delay><history>90</history><trends>365</trends><status>0</status><value_type>3</value_type><allowed_hosts/><units/><delta>0</delta><snmpv3_contextname/><snmpv3_securityname/><snmpv3_securitylevel>0</snmpv3_securitylevel><snmpv3_authprotocol>0</snmpv3_authprotocol><snmpv3_authpassphrase/><snmpv3_privprotocol>0</snmpv3_privprotocol><snmpv3_privpassphrase/><formula>1</formula><delay_flex/><params/><ipmi_sensor/><data_type>0</data_type><authtype>0</authtype><username/><password/><publickey/><privatekey/><port/><description/><inventory_link>0</inventory_link><applications><application><name>ssdb</name></application></applications><valuemap/><logtimefmt/><application_prototypes><application_prototype><name>ssdb cmd discovery</name></application_prototype></application_prototypes></item_prototype><item_prototype><name>ssdb cmd $1 $2</name><type>0</type><snmp_community/><multiplier>0</multiplier><snmp_oid/><key>ssdb[{#SSDBCMD},time_proc]</key><delay>30</delay><history>90</history><trends>365</trends><status>0</status><value_type>3</value_type><allowed_hosts/><units/><delta>0</delta><snmpv3_contextname/><snmpv3_securityname/><snmpv3_securitylevel>0</snmpv3_securitylevel><snmpv3_authprotocol>0</snmpv3_authprotocol><snmpv3_authpassphrase/><snmpv3_privprotocol>0</snmpv3_privprotocol><snmpv3_privpassphrase/><formula>1</formula><delay_flex/><params/><ipmi_sensor/><data_type>0</data_type><authtype>0</authtype><username/><password/><publickey/><privatekey/><port/><description/><inventory_link>0</inventory_link><applications><application><name>ssdb</name></application></applications><valuemap/><logtimefmt/><application_prototypes><application_prototype><name>ssdb cmd discovery</name></application_prototype></application_prototypes></item_prototype><item_prototype><name>ssdb cmd $1 $2</name><type>0</type><snmp_community/><multiplier>0</multiplier><snmp_oid/><key>ssdb[{#SSDBCMD},time_wait]</key><delay>30</delay><history>90</history><trends>365</trends><status>0</status><value_type>3</value_type><allowed_hosts/><units/><delta>0</delta><snmpv3_contextname/><snmpv3_securityname/><snmpv3_securitylevel>0</snmpv3_securitylevel><snmpv3_authprotocol>0</snmpv3_authprotocol><snmpv3_authpassphrase/><snmpv3_privprotocol>0</snmpv3_privprotocol><snmpv3_privpassphrase/><formula>1</formula><delay_flex/><params/><ipmi_sensor/><data_type>0</data_type><authtype>0</authtype><username/><password/><publickey/><privatekey/><port/><description/><inventory_link>0</inventory_link><applications><application><name>ssdb</name></application></applications><valuemap/><logtimefmt/><application_prototypes><application_prototype><name>ssdb cmd discovery</name></application_prototype></application_prototypes></item_prototype></item_prototypes><trigger_prototypes/><graph_prototypes><graph_prototype><name>ssdb {#SSDBCMD}</name><width>900</width><height>200</height><yaxismin>0.0000</yaxismin><yaxismax>100.0000</yaxismax><show_work_period>1</show_work_period><show_triggers>1</show_triggers><type>0</type><show_legend>1</show_legend><show_3d>0</show_3d><percent_left>0.0000</percent_left><percent_right>0.0000</percent_right><ymin_type_1>0</ymin_type_1><ymax_type_1>0</ymax_type_1><ymin_item_1>0</ymin_item_1><ymax_item_1>0</ymax_item_1><graph_items><graph_item><sortorder>0</sortorder><drawtype>0</drawtype><color>1A7C11</color><yaxisside>0</yaxisside><calc_fnc>2</calc_fnc><type>0</type><item><host>Template App SSDB</host><key>ssdb[{#SSDBCMD},calls]</key></item></graph_item><graph_item><sortorder>1</sortorder><drawtype>0</drawtype><color>F63100</color><yaxisside>0</yaxisside><calc_fnc>2</calc_fnc><type>0</type><item><host>Template App SSDB</host><key>ssdb[{#SSDBCMD},time_proc]</key></item></graph_item><graph_item><sortorder>2</sortorder><drawtype>0</drawtype><color>2774A4</color><yaxisside>0</yaxisside><calc_fnc>2</calc_fnc><type>0</type><item><host>Template App SSDB</host><key>ssdb[{#SSDBCMD},time_wait]</key></item></graph_item></graph_items></graph_prototype></graph_prototypes><host_prototypes/></discovery_rule></discovery_rules><httptests/><macros><macro><macro>{$SSDB.PORT}</macro><value>8888</value></macro></macros><templates/><screens/></template></templates><triggers><trigger><expression>{Template App SSDB:net.tcp.listen[{$SSDB.PORT}].last()}=0</expression><recovery_mode>1</recovery_mode><recovery_expression>{Template App SSDB:net.tcp.listen[{$SSDB.PORT}].last()}=1</recovery_expression><name>ssdb is down on {HOST.NAME}</name><correlation_mode>0</correlation_mode><correlation_tag/><url/><status>0</status><priority>4</priority><description/><type>0</type><manual_close>0</manual_close><dependencies/><tags/></trigger><trigger><expression>{Template App SSDB:ssdb[binlogs].last()} - {Template App SSDB:ssdb[replication.client,last_seq].last()} > 3600</expression><recovery_mode>0</recovery_mode><recovery_expression/><name>ssdb replacation is behind on {HOST.NAME}</name><correlation_mode>0</correlation_mode><correlation_tag/><url/><status>0</status><priority>2</priority><description/><type>0</type><manual_close>0</manual_close><dependencies><dependency><name>ssdb replacation is failed on {HOST.NAME}</name><expression>{es1:ssdb[replication.client,status].str(SYNC)}<>1</expression><recovery_expression/></dependency></dependencies><tags/></trigger><trigger><expression>{Template App SSDB:ssdb[replication.client,status].str(SYNC)}<>1</expression><recovery_mode>0</recovery_mode><recovery_expression/><name>ssdb replacation is failed on {HOST.NAME}</name><correlation_mode>0</correlation_mode><correlation_tag/><url/><status>0</status><priority>2</priority><description/><type>0</type><manual_close>0</manual_close><dependencies><dependency><name>ssdb is down on {HOST.NAME}</name><expression>{es1:net.tcp.listen[{$SSDB.PORT}].last()}=0</expression><recovery_expression>{es1:net.tcp.listen[{$SSDB.PORT}].last()}=1</recovery_expression></dependency></dependencies><tags/></trigger><trigger><expression>{Template App SSDB:ssdb[available].last()}<>1</expression><recovery_mode>0</recovery_mode><recovery_expression/><name>ssdb service availability on {HOST.NAME}</name><correlation_mode>0</correlation_mode><correlation_tag/><url/><status>0</status><priority>2</priority><description/><type>0</type><manual_close>0</manual_close><dependencies><dependency><name>ssdb is down on {HOST.NAME}</name><expression>{Template App SSDB:net.tcp.listen[{$SSDB.PORT}].last()}=0</expression><recovery_expression>{Template App SSDB:net.tcp.listen[{$SSDB.PORT}].last()}=1</recovery_expression></dependency></dependencies><tags/></trigger></triggers><graphs><graph><name>ssdb current connections</name><width>900</width><height>200</height><yaxismin>0.0000</yaxismin><yaxismax>100.0000</yaxismax><show_work_period>1</show_work_period><show_triggers>1</show_triggers><type>0</type><show_legend>1</show_legend><show_3d>0</show_3d><percent_left>0.0000</percent_left><percent_right>0.0000</percent_right><ymin_type_1>0</ymin_type_1><ymax_type_1>0</ymax_type_1><ymin_item_1>0</ymin_item_1><ymax_item_1>0</ymax_item_1><graph_items><graph_item><sortorder>0</sortorder><drawtype>0</drawtype><color>1A7C11</color><yaxisside>0</yaxisside><calc_fnc>2</calc_fnc><type>0</type><item><host>Template App SSDB</host><key>ssdb[links]</key></item></graph_item></graph_items></graph><graph><name>ssdb database size estimate</name><width>900</width><height>200</height><yaxismin>0.0000</yaxismin><yaxismax>100.0000</yaxismax><show_work_period>1</show_work_period><show_triggers>1</show_triggers><type>0</type><show_legend>1</show_legend><show_3d>0</show_3d><percent_left>0.0000</percent_left><percent_right>0.0000</percent_right><ymin_type_1>0</ymin_type_1><ymax_type_1>0</ymax_type_1><ymin_item_1>0</ymin_item_1><ymax_item_1>0</ymax_item_1><graph_items><graph_item><sortorder>0</sortorder><drawtype>0</drawtype><color>1A7C11</color><yaxisside>0</yaxisside><calc_fnc>2</calc_fnc><type>0</type><item><host>Template App SSDB</host><key>ssdb[dbsize]</key></item></graph_item></graph_items></graph></graphs><value_maps><value_map><name>Service state</name><mappings><mapping><value>0</value><newvalue>Down</newvalue></mapping><mapping><value>1</value><newvalue>Up</newvalue></mapping></mappings></value_map></value_maps></zabbix_export>文件下载:zbx_ssdb_templates.xml
- 脚本
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960$ cat /etc/zabbix/libexec/ssdb.py#!/bin/env pythonimport sys,json,socket,refrom SSDB import SSDBdef get_stats(ip,port):ssdb = SSDB(ip, port)info = ssdb.request('info',['cmd'])result= info.data[1:]return resultdef discovery_cmd(info):d={'data':[]}for i in range(0,len(info),2):if info[i].find('cmd') != -1:d['data'].append({'{#SSDBCMD}':info[i]})return json.dumps(d)def check(ip,port):ssdb = SSDB(ip, port)try:ssdb.request('set', ['zabbix', '123'])ssdb.request('get', ['zabbix'])return 1except:return 0if __name__ == '__main__':ip = socket.gethostbyname(socket.getfqdn(socket.gethostname()))port = 8888stats = get_stats(ip,port)res = {}for i in range(0,len(stats),2):if stats[i] == 'replication':stats[i] = stats[i]+'.'+stats[i+1].split()[0]res[stats[i]] = stats[i+1]cmd = sys.argv[1]filter = sys.argv[2] if len(sys.argv) > 2 else ''if cmd == 'discover':print discovery_cmd(stats)elif cmd.find('cmd') != -1:p = re.compile('(\w+):\s+(\d+)\s+(\w+):\s+(\d+)\s+(\w+):\s+(\d+)')m = p.match(res[cmd])d=dict(zip(m.group(1,3,5),m.group(2,4,6)))#print d[filter]print d.get(filter,'not support')elif cmd == 'replication.client':for i in res['replication.client'].split('\n'):if i.split(':')[0].strip() == filter:print i.split(':')[1].strip()elif cmd == 'binlogs':print res['binlogs'].split('\n')[-1].split(':')[-1].strip()elif cmd == 'available':print check(ip,port)else:print res.get(cmd,'not support')
- userparameter配置
123$ cat /etc/zabbix/zabbix_agentd.d/userparameter_ssdb.confUserParameter=ssdb.cmd.discovery,/etc/zabbix/libexec/ssdb.py discoverUserParameter=ssdb[*],/etc/zabbix/libexec/ssdb.py $1 $2
需要使用到ssdb的python客户端,我这里是使用ssdb源码自带的python客户端。
item的定义:
triggers定义:
注意:适用于ssdb 主主复制。单实例、主从、多主并未测试过。
zabbix 监控ssdb的更多相关文章
- 使用Zabbix监控Oracle数据库
Orabbix介绍 监控Oracle数据库我们需要安装第三方提供的Zabbix插件,我们先测试比较有名的Orabbix,http://www.smartmarmot.com/product/orabb ...
- Zabbix监控nginx-rtmp status(json版)
与前面的文章 zabbix监控nginx-rtmp status(html版)区别只在于取值的页面不一样 http://127.0.0.1:81/control/get/all_streams sta ...
- Zabbix监控mysql performance
介绍 zabbix监控mysql性能,使用zabbix自带的mysql监控模板,可以监控以下内容OPS(增删改查).mysql慢查询数量.mysql请求\响应流量带宽 配置 新建mysql监控用户 G ...
- zabbix监控Java 8080端口
linux下端口和服务是对应的,Java进程启动时默认监听8080端口,如果服务挂掉则8080端口就没有了. lsof -i:8080 端口,如果没有任何的输出,说明该端口不在工作. 想在zabbix ...
- zabbix监控报错zabbix server is not running解决方法
问题描述: 布置好zabbix监控,正常运行.但是重启了虚拟机服务器之后,页面出现如下的报错,而且设置的报信息也是失效的:
- Zabbix监控Tengine
title: Zabbix监控Tengine tags: zabbix,nginx,tengine author: Chinge Yang date: 2016-12-29 --- Zabbix监控T ...
- zabbix 监控web网站性能
一直在纠结用什么实例来给大家演示呢?想来想去还是官方的好,那我们怎么用zabbix监控web性能和可用性呢?我们这边分为几个步骤:打开网站.登陆.登陆验证.退出,一共4个小step,看实例. 检测流程 ...
- Zabbix监控disk performance
概述 zabbix获取/sys里面的磁盘信息并分析来监控disk performance sysfs是Linux内核中设计较新的一种虚拟的基于内存的文件系统,它的作用与 proc 有些类似(默认挂载在 ...
- Zabbix监控mysql主从复制状态
原理 mysql slave show slave status\G 在输出信息中查看I/O线程和SQL线程的状态值(YES为正常,NO为错误) Slave_IO_Running: Yes Slave ...
随机推荐
- POJ 1273 Drainage Ditches【图论,网络流】
就是普通的网络流问题,想试试新学的dinic算法,这个算法暑假就开始看国家集训队论文了,之前一直都只用没效率的EK算法,真正学会这个算法还是开学后白书上的描述:dinic算法就是不断用BFS构建层次图 ...
- 爱在心中(codevs 2822)
题目描述 Description “每个人都拥有一个梦,即使彼此不相同,能够与你分享,无论失败成功都会感动.爱因为在心中,平凡而不平庸,世界就像迷宫,却又让我们此刻相逢Our Home.” 在爱的国度 ...
- 没有上司的舞会(hdu 1520)
题目描述 Description Ural大学有N个职员,编号为1~N.他们有从属关系,也就是说他们的关系就像一棵以校长为根的树,父结点就是子结点的直接上司.每个职员有一个快乐指数.现在有个周年庆宴会 ...
- jquery 关于ajax 及其son
<%@ page language="java" pageEncoding="UTF-8"%><%@include file="/c ...
- Ubuntu 16.04安装QQ(不一定成功)
注意1:如果是刚新装的系统,可以正常安装,但是,如果你已经装了很多软件,千万不要安装,因为会把系统上一般的依赖包和你之前装的软件全部卸载掉!甚至将桌面Dock都会卸载!最终只能重装Ubuntu解决. ...
- dtrace
http://blog.csdn.net/lw1a2/article/details/7389323
- java去空格
1.trim()是去掉首尾空格 2.str.replace(" ", ""); 去掉所有空格,包括首尾.中间 3.或者replaceAll(&quo ...
- java的计时:毫秒、纳秒
System.currentTimeMillis()获取毫秒值,但是其精度依赖操作系统 想实现较为精确的毫秒,可以采用 System.nanoTime()/1000000L System.nanoTi ...
- Jmeter的几个关键配置文件
1.配置文件位于bin目录下: 2.配置文件可能存在优先级关系,好像user.properties会覆盖jmeter.properties,一般修改配置都是修改或者添加user.properties, ...
- jmeter的jmx脚本结构解析
jmeter的jmx脚本是xml文档,简单分析下其结构 xml是树形结构:jmeter界面的树形结构就是xml的结构 一级目录: 二级目录:在一级目录右键后可以看到的,都可以做为二级目录 三级目录.n ...