def mysqldb_select(): """ :param count: 作为参数传入,控制执行select操作次数 :return: """ count = request.args.get("count") if not count: count = 1 count = int(count) for i in range(count): db_mysqldb.mysqldb_select() return "select count is %d" % count
def get(self): res_1 = db_mysqldb.mysqldb_insert() res_2 = db_mysqldb.mysqldb_delete() res_3 = db_mysqldb.mysqldb_update() res_4 = db_mysqldb.mysqldb_select() self.write("mysqldb\ninsert: %s\ndelete: %s\nupdate: %s\nselect: %s" % (res_1, res_2, res_3, res_4))
def mysqldb_operates(): res_1 = db_mysqldb.mysqldb_insert() res_2 = db_mysqldb.mysqldb_delete() res_3 = db_mysqldb.mysqldb_update() res_4 = db_mysqldb.mysqldb_select() return "mysqldb\ninsert: %s\ndelete: %s\nupdate: %s\nselect: %s" % ( res_1, res_2, res_3, res_4)
def normal_with_sql(): """访问状态:200 响应时间:小于500ms sql:存在sql语句,查询时间大于10ms,小于500ms :return: """ rlv = db_mysqldb.mysqldb_select() return str(rlv)
def slow_action_with_sql(): """访问状态:200 响应时间:大于2000ms sql:存在sql语句,查询时间大于10ms,小于500ms :return: """ time.sleep(3) rlv = db_mysqldb.mysqldb_select() return str(rlv)
def do_thing(): rtv = db_mysqldb.mysqldb_select() return str(rtv)
def get(self): count = self.get_argument("count", 1) count = int(count) for i in range(count): db_mysqldb.mysqldb_select() self.write("select count is %d" % count)
def callback(ch, method, header, body): rlt = db_mysqldb.mysqldb_select() print identify + "get body is %s\nsql result is %s" % (str(body), rlt)