Пример #1
0
def main():
    print('-----------------------', datetime.datetime.now())
    sw = {
        'w': lambda: TimeUtil.get_time_weeks(FLAGS.time_interval),
        'd': lambda: TimeUtil.get_time_days(FLAGS.time_interval),
        'h': lambda: TimeUtil.get_time_hours(FLAGS.time_interval),
        'm': lambda: TimeUtil.get_time_minutes(FLAGS.time_interval, TIME_END),
        's': lambda: TimeUtil.get_time_seconds(FLAGS.time_interval),
    }
    if FLAGS.time_interval > 0:
        global TIME_BEGIN
        global TIME_END
        TIME_BEGIN, TIME_END = sw[FLAGS.time_format]()
    print(TIME_BEGIN, TIME_BEGIN - FLAGS.time_period * 1000)

    hadoop_util.get_cluster_information()
    hadoop_util.get_commonjobs_information()
    response = requests.get("http://127.0.0.1:5001/update/all")
    if response.status_code == 200:
        print("success request http://127.0.0.1:5001/update/all")
        # response = requests.get('http://127.0.0.1:5002/train_lstm')
        # if response.status_code == 200:
        #   print("success request http://127.0.0.1:5002/train_lstm")
        # else:
        #   print("fail request http://127.0.0.1:5002/train_lstm")
    else:
        print("fail request http://127.0.0.1:5001/update/all")
Пример #2
0
def main():
    query_parameters = {"state": FLAGS.state}
    sw = {
        'w': lambda: TimeUtil.get_time_weeks(FLAGS.time_interval),
        'd': lambda: TimeUtil.get_time_days(FLAGS.time_interval),
        'h': lambda: TimeUtil.get_time_hours(FLAGS.time_interval),
        'm': lambda: TimeUtil.get_time_minutes(FLAGS.time_interval),
        's': lambda: TimeUtil.get_time_seconds(FLAGS.time_interval),
    }
    if FLAGS.time_interval > 0:
        finished_time_begin, finished_time_end = sw[FLAGS.time_format]()
        query_parameters["finishedTimeBegin"] = finished_time_begin
        query_parameters["finishedTimeEnd"] = finished_time_end

    thread_main(query_parameters)
Пример #3
0
def main():
    print('-----------------------', datetime.datetime.now())
    sw = {
        'w': lambda: TimeUtil.get_time_weeks(FLAGS.time_interval),
        'd': lambda: TimeUtil.get_time_days(FLAGS.time_interval),
        'h': lambda: TimeUtil.get_time_hours(FLAGS.time_interval),
        'm': lambda: TimeUtil.get_time_minutes(FLAGS.time_interval, TIME_END),
        's': lambda: TimeUtil.get_time_seconds(FLAGS.time_interval),
    }
    if FLAGS.time_interval > 0:
        global TIME_BEGIN
        global TIME_END
        TIME_BEGIN, TIME_END = sw[FLAGS.time_format]()
    print(TIME_BEGIN, TIME_BEGIN - FLAGS.time_period * 1000)

    hadoop_util.get_cluster_information()
    hadoop_util.get_commonjobs_information()