Exemplo n.º 1
0
    def start_sync():
        if args.do_stats:
            sl = StatsLogger(
                "soledad-sync", args.logfile, procs=["python"], interval=0.001)
            sl.start()
        else:
            sl = None

        if args.do_plop:
            plop_collector = get_and_run_plop_collector()
        else:
            plop_collector = None

        if args.do_theseus:
            theseus = get_and_run_theseus_tracer()
        else:
            theseus = None

        t0 = datetime.now()
        d = s.sync()
        d.addCallback(onSyncDone, sl, t0, plop_collector, theseus)
Exemplo n.º 2
0
    def start_sync():
        if args.do_stats:
            sl = StatsLogger(
                "soledad-sync", args.logfile, procs=["python"], interval=0.001)
            sl.start()
        else:
            sl = None

        if args.do_plop:
            plop_collector = get_and_run_plop_collector()
        else:
            plop_collector = None

        if args.do_theseus:
            theseus = get_and_run_theseus_tracer()
        else:
            theseus = None

        t0 = datetime.now()
        d = s.sync()
        d.addCallback(onSyncDone, sl, t0, plop_collector, theseus)
Exemplo n.º 3
0
    parser.add_argument(
        '-l', dest='logfile', required=False, default='/tmp/profile.log',
        help='the file to which write the log')
    args = parser.parse_args()

    # get the password
    passphrase = args.passphrase
    if passphrase is None:
        passphrase = getpass.getpass(
            'Password for %s@%s: ' % (args.username, args.provider))

    # get the basedir
    basedir = args.basedir
    if basedir is None:
        basedir = tempfile.mkdtemp()
    logger.info('Using %s as base directory.' % basedir)

    # get the soledad instance
    s = get_soledad_instance(
        args.username, args.provider, passphrase, basedir)
    for i in xrange(10):
        s.create_doc({})

    sl = StatsLogger(
        "soledad-sync", args.logfile, procs=["python"], interval=0.001)
    sl.start()
    s.sync()
    sl.stop()

    #plot(args.logfile)
Exemplo n.º 4
0
                        default='/tmp/profile.log',
                        help='the file to which write the log')
    args = parser.parse_args()

    # get the password
    passphrase = args.passphrase
    if passphrase is None:
        passphrase = getpass.getpass('Password for %s@%s: ' %
                                     (args.username, args.provider))

    # get the basedir
    basedir = args.basedir
    if basedir is None:
        basedir = tempfile.mkdtemp()
    logger.info('Using %s as base directory.' % basedir)

    # get the soledad instance
    s = get_soledad_instance(args.username, args.provider, passphrase, basedir)
    for i in xrange(10):
        s.create_doc({})

    sl = StatsLogger("soledad-sync",
                     args.logfile,
                     procs=["python"],
                     interval=0.001)
    sl.start()
    s.sync()
    sl.stop()

    #plot(args.logfile)