Example #1
0
def myredis_newmedia():
    # adorder=request.args.get('orderno')
    # page=request.args.get('page')
    key = 'voyager:new:media:budget'
    myenv = request.args.get('myenv')

    tmp_all = mr.mygetredis(myenv, key)
    # 当前小时
    # myhour=int(time.strftime("%H", time.localtime()))
    return render_template('myredis_newmedia.html', tmp_all=tmp_all)
Example #2
0
def budget_control():
    adorder = request.args.get('orderno')
    # page=request.args.get('page')
    key = 'voyager:budget_control:' + str(adorder)
    myenv = request.args.get('myenv')
    print key
    tmp_all = mr.mygetredis(myenv, key)
    print tmp_all
    # 当前小时
    myhour = int(time.strftime("%H", time.localtime()))
    return render_template('buggetcontrol.html',
                           tmp_all=tmp_all,
                           myhour=myhour)
Example #3
0
def myredis():
    myform = ft.myredis()
    if myform.validate_on_submit():
        myenv = myform.data['myenv']
        print myenv
        mybudget, allcount, negativecount = mr.mygetredis(
            myenv, 'voyager:budget')
        return render_template('myredis.html',
                               mybudget=mybudget,
                               allcount=allcount,
                               negativecount=negativecount,
                               form=myform,
                               myenv=myenv)
    return render_template('myredis.html', form=myform)
Example #4
0
def myredis():
    if request.method=='GET':
        return render_template('myredis.html')
    else:
        jobid1=request.form.get('jobid')
        # mybudget=''
        if jobid1=='120':
            data='<option selected="selected">缓存中的订单预算:生产</option>'
            redis_nodes=[{"host":'123.59.17.118',"port":'13601'},{"host":'123.59.17.85',"port":'13601'},{"host":'123.59.17.11',"port":'13601'}]
            # mybudget,allcount,negativecount=mr.mygetredis(redis_nodes)
            # return render_template('myredis.html',mybudget=mybudget,allcount=allcount,negativecount=negativecount)
        elif jobid1=='110':
            data='<option selected="selected">缓存中的订单预算:测试</option>'
            redis_nodes=[{"host":'101.254.242.11',"port":'17001'},{"host":'101.254.242.12',"port":'17001'},{"host":'101.254.242.17',"port":'17001'}]
        mybudget,allcount,negativecount=mr.mygetredis(redis_nodes)
        return render_template('myredis.html',mybudget=mybudget,allcount=allcount,negativecount=negativecount,data=data)
Example #5
0
def myredis_hourconsume():
    # adorder=request.args.get('orderno')
    # page=request.args.get('page')
    tmplist = []

    myenv = request.args.get('myenv')

    adorder = request.args.get('orderno')
    hour_now = datetime.now().hour

    tmp_all = []
    for i in range(int(hour_now)):
        key = 'voyager:new:media:budget:hour_{} {}'.format(i, adorder)

        tmp_value = mr.mygetredis(myenv, key)
        tmp_all.append({i: tmp_value})

    # 当前小时
    # myhour=int(time.strftime("%H", time.localtime()))
    return render_template('myredis_hourconsume.html', tmp_all=tmp_all)
Example #6
0
def ocpa_ordercost():
    if request.method=='GET':
        tmpordercost=mr.mygetredis('1','voyager:ocpa_actual_cost')
        return render_template('ocpaordercost.html',tmpordercost=tmpordercost)
Example #7
0
def ocpa_orderadzonedetail():
    if request.method=='GET':
        # 生产环境
        tmpordeadzonedetail=mr.mygetredis('1','voyager:ocpa_adzones_detail')
        return render_template('ocpaorderadzonedetail.html',tmpordeadzonedetail=tmpordeadzonedetail)