prometheus(普罗米修斯)入门使用
prometheus(普罗米修斯)入门使用一 说明Prometheus是最近几年开始流行的一个新兴监控告警工具,特别是 kubernetes 的流行带动了 prometheus 的应用。Prometheus 是一套完整的监控告警系统:
Prometheus的主要特点有:
12345671. a multi-dimensional data model with time series data identified by metric name and key/value pairs2. a flexible query language to leverage this dimensionality3. no reliance on distributed storage; single server nodes are autonomous4. time series collection happens via a pull model over HTTP5. pushing time series is supported via an intermediary gatewa ...
list and tuple
list and tuplelist 列表123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263>>> zhangyin = [ zhang , yin ]Traceback (most recent call last): File "<stdin>", line 1, in <module>NameError: name 'zhang' is not defined>>> zhangyin=[zhang,yin]Traceback (most recent call last): File "<stdin>", line 1, in <module>NameError: name 'zhang' is not defined>> ...
supervisor增删节点
12sudo supervisorctl rereadsudo supervisorctl update
split命令
split命令文件过滤分割与合并
split命令可以将一个大文件分割成很多个小文件,有时需要将文件分割成更小的片段,比如为提高可读性,生成日志等。
选项1234-b:值为每一输出档案的大小,单位为 byte。-C:每一输出档中,单行的最大 byte 数。-d:使用数字作为后缀。-l:值为每一输出档的列数大小。
实例生成一个大小为100KB的测试文件:
1234[root@localhost split]# dd if=/dev/zero bs=100k count=1 of=date.file1+0 records in1+0 records out102400 bytes (102 kB) copied, 0.00043 seconds, 238 MB/s
使用split命令将上面创建的date.file文件分割成大小为10KB的小文件:
123[root@localhost split]# split -b 10k date.file [root@localhost split]# lsdate.file xaa xab xac xad xae xaf xag ...
flask笔记-使用mysql连接池
flask笔记-使用mysql连接池在项目中,因为需要频繁进行sql操作,如果不使用连接池,在sql操作时每次都要重新建立连接,影响性能。
这里使用的mysql-connecter模块自带的mysql-connecter-pooling连接池。
官方说明官网地址
实际使用使用时我是分了三个步骤
1.创建连接池create_db_pool.py
123456789101112131415import mysql.connector.poolingfrom readconf import readconfhost = readconf("Mysql-Database", "host")user = readconf("Mysql-Database", "user")password = readconf("Mysql-Database", "password")database = readconf("Mysql-Database", "da ...